02.02.2011, 17:01
Olб pessoal, boa tarde a todos, vi na wiki sa-mp(https://sampwiki.blast.hk/wiki/Tutorial_of_strtok) um tutorial de strtok, e entendi como fazer, sу que eu peguei o codigo que eles usaram pra ensinar, coloquei no meu GM, e deram alguns erros meio estranhos, porque eu fiz tudo que a wiki mandou...
Esses sao os erros, e as respectivas linhas, queria que alguem me ajudasse por favor, eu entendi o motivo dos erros, so nao sei como corrigi-los ):
Conforme forem surgindo duvidas vou editando aqui obg pela atenзao
@DUVIDA 2
Alguem sabe o id Do caixa bancario?
pawn Код:
C:\Documents and Settings\XP\Desktop\Nova pasta\gamemodes\GoldFish.pwn(92) : error 017: undefined symbol "strtok"
C:\Documents and Settings\XP\Desktop\Nova pasta\gamemodes\GoldFish.pwn(92) : error 033: array must be indexed (variable "cmd")
C:\Documents and Settings\XP\Desktop\Nova pasta\gamemodes\GoldFish.pwn(93) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\XP\Desktop\Nova pasta\gamemodes\GoldFish.pwn(93) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\XP\Desktop\Nova pasta\gamemodes\GoldFish.pwn(97) : error 017: undefined symbol "strtok"
C:\Documents and Settings\XP\Desktop\Nova pasta\gamemodes\GoldFish.pwn(97) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\XP\Desktop\Nova pasta\gamemodes\GoldFish.pwn(100) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\XP\Desktop\Nova pasta\gamemodes\GoldFish.pwn(100) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\XP\Desktop\Nova pasta\gamemodes\GoldFish.pwn(91) : warning 203: symbol is never used: "idx"
C:\Documents and Settings\XP\Desktop\Nova pasta\gamemodes\GoldFish.pwn(91 -- 109) : warning 209: function "OnPlayerCommandText" should return a value
C:\Documents and Settings\XP\Desktop\Nova pasta\gamemodes\GoldFish.pwn(91 -- 110) : error 010: invalid function or declaration
C:\Documents and Settings\XP\Desktop\Nova pasta\gamemodes\GoldFish.pwn(91 -- 110) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
10 Errors.
pawn Код:
89public OnPlayerCommandText(playerid, cmdtext[])
90{
91 new tmp[128], string[128], cmd[128], idx, giveplayerid, sendername, giveplayer;
92 cmd = strtok(cmdtext, idx);
93 GetPlayerName(playerid, sendername, sizeof(sendername));
95 if(strcmp(cmd, "/akill", true) == 0)
96 {
97 if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0x919191FF, "You must be admin to admin-kill someone.");
98 tmp = strtok(cmdtext, idx);
98 if(!strlen(tmp)) return SendClientMessage(playerid, 0x919191FF, "Usage: \"/akill [ID]\"");
99 giveplayerid = strval(tmp);
100 GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
101 if(!IsPlayerConnected(giveplayerid))SendClientMessage(playerid, 0x919191FF, "Player not found.");
102 SetPlayerHealth(giveplayerid, 0);
103 format(string, sizeof(string), "Admin %s[%i] killed you!", sendername, playerid);
104 SendClientMessage(giveplayerid, 0xE21D2CFF, string);
105 format(string, sizeof(string), "Killed %s[%i]!", giveplayer, giveplayerid);
106 SendClientMessage(playerid, 0xE21D2CFF, string);
107 return 1;
108 }
109}
110 return 0;
111}
Conforme forem surgindo duvidas vou editando aqui obg pela atenзao

@DUVIDA 2
Alguem sabe o id Do caixa bancario?