11.05.2009, 13:19
Now I use this ban command:
This shows on NAME has been banned for: reason
Name always replaces the ID 0 name, if I kicked example ID 1
I've also tried this in my code:
But this one appears many errors, what is wrong and could someone give me working version
Thanks
Код:
else if (streq(cmd,"/ban")) { new id=GetId(playerid,rest); if (id==INVALID_PLAYER_ID) return 1; new ID = strval(cmdtext[6]); new pName[24], str[64]; if(IsPlayerConnected(ID)) GetPlayerName(ID, pName, 24); format(str, 64, "%s has been banned from the server for: %s", pName,rest); SendClientMessageToAll(COLOR_ORED, str); print("Player banned"); Ban(ID); return 1; }
Name always replaces the ID 0 name, if I kicked example ID 1
I've also tried this in my code:
Код:
else if(strcmp(cmdtext, "/ban", true, 5)==0) { if(!IsPlayerAdmin(playerid)) return 0; if(!strlen(cmdtext[6])) { SendClientMessage(playerid, COLOR_ORED, "Usage: /ban [playerid] [reason]"); return 1; } new ID = strval(cmdtext[6]); new pName[24], str[64]; if(IsPlayerConnected(ID)) { GetPlayerName(ID, pName, 24); format(str, 64, "%s has been banned from the server for: %s", pName,rest); SendClientMessageToAll(COLOR_ORED, str); print("Player banned"); Ban(ID); } return 1; }
Thanks