14.10.2011, 04:19
Olб galera
Bom eu estava, colocano um comando chamado /pm (mensagem particular) e deu uns erro e nгo consigo arrumar, vcs podem me ajudar ? Vou postar Os erro, as linha e o Comando inteiro ok ?
Erros :
Linhas :
Comando inteiro :
Bom eu estava, colocano um comando chamado /pm (mensagem particular) e deu uns erro e nгo consigo arrumar, vcs podem me ajudar ? Vou postar Os erro, as linha e o Comando inteiro ok ?
Erros :
pawn Код:
C:\Documents and Settings\FAMILIA_\Desktop\Iniciante\gamemodes\testing.pwn(309) : error 017: undefined symbol "strtok"
C:\Documents and Settings\FAMILIA_\Desktop\Iniciante\gamemodes\testing.pwn(309) : error 033: array must be indexed (variable "cmd")
C:\Documents and Settings\FAMILIA_\Desktop\Iniciante\gamemodes\testing.pwn(314) : error 017: undefined symbol "strtok"
C:\Documents and Settings\FAMILIA_\Desktop\Iniciante\gamemodes\testing.pwn(314) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\FAMILIA_\Desktop\Iniciante\gamemodes\testing.pwn(322) : error 017: undefined symbol "strrest"
C:\Documents and Settings\FAMILIA_\Desktop\Iniciante\gamemodes\testing.pwn(322) : error 033: array must be indexed (variable "gMessage")
C:\Documents and Settings\FAMILIA_\Desktop\Iniciante\gamemodes\testing.pwn(307) : warning 203: symbol is never used: "idx"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
6 Errors.
pawn Код:
/*Erro 309*/
cmd = strtok(cmdtext, idx);
/*Erro 314*/
tmp = strtok(cmdtext,idx);
/*Erro 322*/
gMessage = strrest(cmdtext,idx);
/*Erro 307*/
new idx;
pawn Код:
new cmd[256];
new tmp[256];
new Message[256];
new gMessage[256];
new pName[MAX_PLAYER_NAME+1];
new iName[MAX_PLAYER_NAME+1];
new idx;
cmd = strtok(cmdtext, idx);
// PM Command
if(strcmp("/pm", cmd, true) == 0)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp) || strlen(tmp) > 5) {
SendClientMessage(playerid,0xFFFF00FF,"Usage: /pm (id) (message)");
return 1;
}
new id = strval(tmp);
gMessage = strrest(cmdtext,idx);
if(!strlen(gMessage)) {
SendClientMessage(playerid,0xFFFF00FF,"Usage: /pm (id) (message)");
return 1;
}
if(!IsPlayerConnected(id)) {
SendClientMessage(playerid,0xFFFF00FF,"/pm : Bad player ID");
return 1;
}
if(playerid != id) {
GetPlayerName(id,iName,sizeof(iName));
GetPlayerName(playerid,pName,sizeof(pName));
format(Message,sizeof(Message),">> %s(%d): %s",iName,id,gMessage);
SendClientMessage(playerid,0xFFFF00FF,Message);
format(Message,sizeof(Message),"** %s(%d): %s",pName,playerid,gMessage);
SendClientMessage(id,0xFFFF00FF,Message);
PlayerPlaySound(id,1085,0.0,0.0,0.0);
printf("PM: %s",Message);
}
else {
SendClientMessage(playerid,0xFFFF00FF,"You cannot PM yourself");
}
return 1;
}