13.03.2011, 19:06
Hello,I don't know how to fix this.My Ban command:
and my warnings and erros:
Any help ?
Код:
dcmd_ban(playerid, params[]) { if(gPlayerLogged[playerid] = 1) { if(PlayerInfo[playerid][pAdminLevel] >= 1) { new tmp[256], tmp2[256]; tmp = strtok(params) tmp2 = strtok(params) if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /ban [playerid] [reason]"); if(!strlen(tmp2)) return SendClientMessage(playerid, COLOR_RED, "ERROR: You must give a reason"); strval(tmp) = playerid; new string[128]; new playername[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername, sizeof(playername)); format(string,sizeof(string),"%s have been banned from this server[Reason: %s]",playername,params[2]); SendClientMessageToAll(COLOR_RED,string); BanEx(playerid,string); } else{ SendClientMessage(playerid, COLOR_RED, "You are not admin."); } } return; }
Код:
C:\Users\bendra\Desktop\Samp Serveriai\Serv\gamemodes\LSTW2v2.pwn(2066) : warning 211: possibly unintended assignment C:\Users\bendra\Desktop\Samp Serveriai\Serv\gamemodes\LSTW2v2.pwn(2069) : warning 202: number of arguments does not match definition C:\Users\bendra\Desktop\Samp Serveriai\Serv\gamemodes\LSTW2v2.pwn(2070) : error 001: expected token: ";", but found "-identifier-" C:\Users\bendra\Desktop\Samp Serveriai\Serv\gamemodes\LSTW2v2.pwn(2070) : warning 202: number of arguments does not match definition C:\Users\bendra\Desktop\Samp Serveriai\Serv\gamemodes\LSTW2v2.pwn(2071) : error 001: expected token: ";", but found "if" C:\Users\bendra\Desktop\Samp Serveriai\Serv\gamemodes\LSTW2v2.pwn(2073) : error 022: must be lvalue (non-constant) C:\Users\bendra\Desktop\Samp Serveriai\Serv\gamemodes\LSTW2v2.pwn(2073) : warning 215: expression has no effect C:\Users\bendra\Desktop\Samp Serveriai\Serv\gamemodes\LSTW2v2.pwn(2085) : warning 217: loose indentation C:\Users\bendra\Desktop\Samp Serveriai\Serv\gamemodes\LSTW2v2.pwn(2085) : warning 209: function "dcmd_ban" should return a value Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors.