10.08.2013, 23:54
My friend taught me how to make a /kick command ((I suck at scripting)). We usually use ZCMD but it wasn't working so we used to default strcmp.. For some reason I get 2 errors.
Code:
Compiler:
Code:
Quote:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/kick", cmdtext, true, 10) == 0) { new string[180], reason[80], giveplayerid; if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "COMMAND /simplekick [id] [why]"); if(!IsPlayerAdmin(playerid)) { SendClientMessage(playerid, COLOR_WHITE, "You Are not an Admin!"); } else { format(string, sizeof(string), "%s has been kicked by %s - Reason: %s", GetPlayerName(giveplayerid), GetPlayerName(playerid), reason); SendClientMessageToAll(COLOR_WHITE, string); Kick(giveplayerid); } return 1; } return 0; } |
Quote:
C:\Users\jack\Desktop\LARP\gamemodes\kicktesting.p wn(94) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\jack\Desktop\LARP\gamemodes\kicktesting.p wn(94) : warning 219: local variable "giveplayerid" shadows a variable at a preceding level C:\Users\jack\Desktop\LARP\gamemodes\kicktesting.p wn(95) : error 017: undefined symbol "params" C:\Users\jack\Desktop\LARP\gamemodes\kicktesting.p wn(102) : warning 202: number of arguments does not match definition C:\Users\jack\Desktop\LARP\gamemodes\kicktesting.p wn(102) : warning 202: number of arguments does not match definition C:\Users\jack\Desktop\LARP\gamemodes\kicktesting.p wn(102) : warning 202: number of arguments does not match definition C:\Users\jack\Desktop\LARP\gamemodes\kicktesting.p wn(102) : warning 202: number of arguments does not match definition C:\Users\jack\Desktop\LARP\gamemodes\kicktesting.p wn(245) : warning 203: symbol is never used: "giveplayerid" C:\Users\jack\Desktop\LARP\gamemodes\kicktesting.p wn(245) : warning 203: symbol is never used: "string" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error. |