17.12.2009, 00:55
for the strtok is good it just giving me a warning of tag mismatch but its all good gonna go test now =P thanks for the fast reply doesnt work in game heres a ban command for the admin filter script im using
if(strcmp("/ban", cmd, true) == 0)
{
tmp = strtok(cmdtext, idx);
if(PLVL[playerid] == 0) return SendClientMessage(playerid, red, "ERROR: You're not an admin!");
if(!strlen(tmp)) return SendClientMessage(playerid, red, "ERROR: You didn't put in an id!");
if(strval(tmp) == playerid) return SendClientMessage(playerid, red, "ERROR: You can't ban yourself!");
if(IsPlayerConnected(strval(tmp)) == 0) return SendClientMessage(playerid, red, "ERROR: No player with such id!");
cmdid = strval(tmp);
format(string, sizeof(string), "NOTICE: %s have banned %s from the server.", prname, idname);
SendClientMessageToAll(yellow, string);
print(string);
Ban(cmdid);
return 1;
}
if(strcmp("/ban", cmd, true) == 0)
{
tmp = strtok(cmdtext, idx);
if(PLVL[playerid] == 0) return SendClientMessage(playerid, red, "ERROR: You're not an admin!");
if(!strlen(tmp)) return SendClientMessage(playerid, red, "ERROR: You didn't put in an id!");
if(strval(tmp) == playerid) return SendClientMessage(playerid, red, "ERROR: You can't ban yourself!");
if(IsPlayerConnected(strval(tmp)) == 0) return SendClientMessage(playerid, red, "ERROR: No player with such id!");
cmdid = strval(tmp);
format(string, sizeof(string), "NOTICE: %s have banned %s from the server.", prname, idname);
SendClientMessageToAll(yellow, string);
print(string);
Ban(cmdid);
return 1;
}