01.09.2009, 10:07
Hey there,
Iґve scripted some little command for the lolz, /fakeban. It kicks players and sends the same message when banning ^_^ Itґs great to have some fun.
But the command seems not to use the correct IDґs, everytime I enter /fakeban 12, it kicks ID 18, and so on. Whereґs the problem?
Iґve scripted some little command for the lolz, /fakeban. It kicks players and sends the same message when banning ^_^ Itґs great to have some fun.
Код:
if(strcmp(cmd, "/fakeban", true) == 0) // Kicks the player from the server { new reason[128]; if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, ORANGE, "USAGE: /fakeban [playername/id] [reason]"); SendClientMessage(playerid, ORANGE, "FUNCTION: Will kick the specified player."); return 1; } if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername)); GetPlayerName(playerid, sendername, sizeof(sendername)); reason = bigstrtok(cmdtext, idx); if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /fakeban [playername/id] [reason]"); printf("ADMIN: Admin %s kicked %s. Reason: %s", sendername, giveplayername, reason); format(string, sizeof(string), "-| Administrator %s banned %s. [Reason: %s ] |-", sendername, giveplayername, reason); SendClientMessageToAll(ADMIN_RED, string); Kick(giveplayerid); KickLog(string); } else if(giveplayerid == INVALID_PLAYER_ID) { format(string, sizeof(string), "%d is not an active player.", giveplayerid); SendClientMessage(playerid, RED, string); } } else SendClientMessage(playerid, RED, "You are not an admin with the required level."); return 1; }