09.06.2011, 17:55
Tipo galera eu tava tentando criar um sistema de avisos pro meu server de drift, se o player nгo obedecer as regras um adm digita /aviso [id] [motivo] e o player й avisado, depois de 3 avisos ele й kickado, mais ta dando error:
codigo:
Ja coloquei new cmd; new cmd [256]; e mesmo assim da esse erro .Serб que vocкs poderiam me ajudar? Obrigado pela atenзгo.
Код:
C:\Documents and Settings\Admin\Desktop\Drift Dominio\GM DDO\gamemodes\[GM]Drift.pwn(751) : error 017: undefined symbol "cmd" C:\Documents and Settings\Admin\Desktop\Drift Dominio\GM DDO\gamemodes\[GM]Drift.pwn(1732) : warning 203: symbol is never used: "VehicleName" C:\Documents and Settings\Admin\Desktop\Drift Dominio\GM DDO\gamemodes\[GM]Drift.pwn(1732) : warning 203: symbol is never used: "ret_memcpy" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
Код:
if(strcmp(cmd, "/aviso", true) == 0) { new idx; new string[256]; new aname[MAX_PLAYER_NAME]; GetPlayerName(playerid, aname, MAX_PLAYER_NAME); if(IsPlayerAdmin(playerid)){ new tmp[256]; new plid; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, Vermelho, "Digite: /aviso [id] [motivo]"); return 1; } plid = strval(tmp); new pname[MAX_PLAYER_NAME]; GetPlayerName(plid, pname, MAX_PLAYER_NAME); if(IsPlayerConnected(plid)){ new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, Vermelho, "{FFFF00}[{E60000} ERRO {FFFF00}]{FFFFFF} Vocк sу pode avisar com uma razгo apropriada!"); }else{ aviso[plid]+=1; if(aviso[plid]>= 3){ format(string, sizeof(string), "* [ Zй_Ninguem(bot) ] kickou o jogador %s (Motivo: limite de avisos)",pname); SendClientMessageToAll(tcadm, string); SetPlayerPos(plid, 831.9581,-1102.1510,24.2969); GameTextForPlayer(plid,"~r~kickado~w~!", 2500, 3); Kick(plid); } format(string, sizeof(string), "* O Administrador %s avisou o jogador: %s. (Motivo: %s - (%d/3)", aname,pname,result,aviso[plid]); SendClientMessageToAll(tcadm, string); } }else{ format(string, sizeof(string), "{FFFF00}[{E60000} ERRO {FFFF00}]{FFFFFF} ID %d nгo й valido.", plid); SendClientMessage(playerid, Vermelho, string); } } return 1; }