[Ajuda]/darvip - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda]/darvip (
/showthread.php?tid=341192)
[Ajuda]/darvip -
mengueh - 09.05.2012
pawn Код:
if(strcmp("/vip", cmdtext, true) == 0)
{
new tmp[256], id;
tmp = strtok (cmdtext, idx);
id = strval(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid, 0xFFFF00AA, "Use: /vip id");
if(PlayerInfo[playerid][pAdmin] < 1 ) return SendClientMessage(playerid, 0xFFFFFFAA, "Vocк precisa ser Admin para usar este comando.");
if(!IsPlayerConnected(playerid))
return SendClientMessage(playerid, "Este jogador nгo estб conectado!");
SendClientMessage(playerid, PRETO, "Agora vocк й VIP, obrigado por contribuir para o servidor");
return 1;
}
Qualй o erro? ):
error 017: undefined symbol "strtok"
error 033: array must be indexed (variable "tmp")
argument type mismatch (argument 2)
Re: [Ajuda]/darvip -
Trigo - 09.05.2012
erro 017:
pawn Код:
//adicione isso no fim do GM
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
error 033:
Verifica ai .... eu axo q o 'tmp' ja ta definido no seu Gm...