08.09.2012, 21:35
add this somewhere in ur script
Credits Come Back To Slice
And Replace The
With
pawn Код:
SSCANF:player_name(string[]) {
new foundplayer = INVALID_PLAYER_ID, name[MAX_PLAYER_NAME];
new bool:numeric = true;
for (new i = 0, c; (c = string[i]); i++) {
if (c < '0' || c > '9') {
numeric = false;
break;
}
}
if (numeric) {
foundplayer = strval(string);
if (IsPlayerConnected(foundplayer))
return foundplayer;
else
foundplayer = INVALID_PLAYER_ID;
}
foreach(new playerid : Player) {
GetPlayerName(playerid, name, sizeof(name));
if (strfind(name, string, true) != -1) {
if (foundplayer != INVALID_PLAYER_ID)
return INVALID_PLAYER_ID; // Multiple matches
else
foundplayer = playerid;
}
}
return foundplayer;
}
And Replace The
Код:
"u"
Код:
"k<player_name>"