ProKreedz Help Thread
u have to add much lines of code for that
1. u have to save steam id from the players which are in top10
2. when someone reach target, it should check if ther is an entry to this steam id (new function)
if no, do nothing
if yes, check if new time is better
if yes, load topten_update
;)
Could anyone do this work ? Or tell me where to find the codes, because I want this function, too :x :rolleyes:
boonsponn if found this in the amxxforums but it looks for the name of the player and not for his steamid.
maybe somebody could edit this? i think most work is done
getTopTenPlace(id) {
new currentMap[32];
get_mapname(currentMap, 32);
new topTenVault[64];
format(topTenVault, 64, "pk_%s", currentMap);
new kzTime;
kzTime = get_systime() - timer_time[id-1];
new vault = nvault_open(topTenVault);
new vaultKey[8];
new vaultReturn[128];
new arg1[32], arg2[8];
new ret;
if(vault != INVALID_HANDLE) {
for(new i = 1; i <= 10; i++) {
format(vaultKey, 8, "%d", i);
nvault_get(vault, vaultKey, vaultReturn, 128);
if(parse(vaultReturn, arg1, 32, arg2, 8) != 0) {
if(kzTime < str_to_num(arg2)) {
ret = i;
break;
} else {
ret = 0;
}
} else {
ret = i;
break;
}
}
}
nvault_close(vault);
return ret;
}
// ==================
isPlayerInTopTen(id) {
new userName[32];
get_user_name(id, userName, 32);
new currentMap[32];
get_mapname(currentMap, 32);
new topTenVault[64];
format(topTenVault, 64, "pk_%s", currentMap);
new vault = nvault_open(topTenVault);
new vaultKey[8];
new vaultReturn[128];
new arg1[32], arg2[8];
new ret;
if(vault != INVALID_HANDLE) {
for(new i = 1; i <= 10; i++) {
format(vaultKey, 8, "%d", i);
nvault_get(vault, vaultKey, vaultReturn, 128);
if(parse(vaultReturn, arg1, 32, arg2, 8) != 0 && equal(userName, arg1)) {
ret = i;
break;
} else {
ret = 0;
}
}
}
nvault_close(vault);
return ret;
}
// ==================
showTime(id, newPlace) {
new userName[32];
get_user_name(id, userName, 32);
new kzTime;
kzTime = get_systime() - timer_time[id-1];
new minutes, seconds
if((kzTime / 60.0) >= 1) {
minutes = floatround(kzTime / 60.0,floatround_floor);
kzTime -= (floatround(kzTime/ 60.0,floatround_floor) * 60);
seconds = kzTime;
} else {
minutes = 0;
seconds = kzTime;
}
set_hudmessage(255, 255, 255, -1.0, -1.0);
if(newPlace == 1) {
show_hudmessage(0, "%s finished the map in %d min %d sec and established a new record", userName, minutes, seconds);
} else if(newPlace == 0) {
show_hudmessage(0, "%s finished the map in %d min %d sec", userName, minutes, seconds);
} else {
show_hudmessage(0, "%s finished the map in %d min %d sec and established a new Top10 time", userName, minutes, seconds);
}
}
// ==================
public topten_update(id) {
new newPlace = getTopTenPlace(id);
new oldPlace = isPlayerInTopTen(id);
new userName[32];
get_user_name(id, userName, 32);
new currentMap[32];
get_mapname(currentMap, 32);
new kzTime;
kzTime = get_systime() - timer_time[id-1];
new vaultEntry[128];
format(vaultEntry, 128, "^"%s^" ^"%d^" ^"%d^"", userName, kzTime, checkpointnum[id-1]);
new topTenVault[64];
format(topTenVault, 64, "pk_%s", currentMap);
new vault = nvault_open(topTenVault);
if(oldPlace > 0) {
if(newPlace > 0 ) {
new key[8];
if(newPlace < oldPlace) {
format(key, 8, "%d", oldPlace);
nvault_remove(vault, key);
for(new i = oldPlace; i > 10; i++) {
new temp[128], tempKey[8]
format(tempKey,8,"%d",i+1)
nvault_get(vault,tempKey,temp,128)
if(!equal(temp,"")) {
format(tempKey,8,"%d",i)
nvault_pset(vault,tempKey,temp)
}
}
for(new i = 10; i > newPlace; i--) {
new temp[128], tempKey[8]
format(tempKey,8,"%d",i-1)
nvault_get(vault,tempKey,temp,128)
if(!equal(temp,"")) {
format(tempKey,8,"%d",i)
nvault_pset(vault,tempKey,temp)
}
}
format(key, 8, "%d", newPlace);
nvault_pset(vault, key, vaultEntry);
} else if(newPlace == oldPlace) {
format(key, 8, "%d", oldPlace);
nvault_remove(vault, key);
format(key, 8, "%d", newPlace);
nvault_pset(vault, key, vaultEntry);
}
showTime(id, newPlace);
}
} else {
if(newPlace > 0) {
for(new i = 10; i > newPlace; i--) {
new temp[128], tempKey[8]
format(tempKey,8,"%d",i-1)
nvault_get(vault,tempKey,temp,128)
if(!equal(temp,"")) {
format(tempKey,8,"%d",i)
nvault_pset(vault,tempKey,temp)
}
}
new key[8];
format(key, 8, "%d", newPlace);
nvault_pset(vault, key, vaultEntry);
showTime(id, newPlace);
}
}
nvault_close(vault);
}
<3 u ^^
I will write this Plugin to check ID today, then I'll edit this answer ^^
First EDIT : So, now I am online again -.- I was out with my girlfriend and then @ way home i was attacked by some turkeys, so I had to go a longer way and so I don't have time to do this today anymore. SORRY. I'll do tomorrow night :D Then I am at home, alone. So, sorry dude ^^
[ Edited Thu Apr 19 2007, 10:38PM ]
go for it <3 ^^
[AMXX] Plugin "prokreedz.amxx" failed to load: Module/Library "cstrike" required for plugin. Check modules.ini.
i really don't know why i've got this error, and then prokreedz.amxx isn't running...
btw i have cstrike in my modules.ini without the semicolon
i think u didn't download the cstrike addon?
http://www.amxmodx.org/downloads.php
or u wrong copied it?
I'm gonna try it again, i hope it's this!
edit : thanks it work
[ Edited Fri Apr 20 2007, 12:17PM ]
How to make that it shows the timer and CP in hud msg on upper side of the screen when the timer is started?
like this
Time: 2:35 | CP: 43
I need that it shows it all the time.
i tryed to do it too and i edited the timer_task for that but everytime when i compiled i got an error... checkpointnum had to be indexed but i dunno what i have to write after checkointnum (i tryed [id],[id-1],[31])
checkpointnum[i-1]
yes i, not id, caus in timer task id will not exist and the number for in [] is generated due the loop """ for(new i=1;i<=get_maxplayers();i++) { """
[ Edited Sun Apr 22 2007, 09:20PM ]
look again on ym code and saw that line xD just wanted to tell u i got no errors at compiling and then i saw ur post :P ty
where to put that top10 code you posted PaPa?
just replace the topten_update function with the code i posted
ye i already figured it out myself. thx
I need help guys.. i want to remove the checkpoint animation that is like some dust surrounding you when you teleport to it... can someone tell me wich line i have to delete or smth ? thx..
It's most likely a SVC_TEMPENTITY, look for message_begin() .. message_end() in the "gocheck" function.
I found it ! thank you fatalis, it works !
;)
[ Edited Sun Apr 29 2007, 07:27PM ]
wtf are you talking about here^^ o.O
my problem is that everytime when i record a demo like this
bind "key" "say /gocheck;stop;record 123"
and I "gocheck" it says "you already have one" in the middle of the screen...quite annoying
what do i have to do?
[ Edited Mon Apr 30 2007, 01:40AM ]
Please log in to post replies.