[Ajuda] erro compilar
#1

gamemodes\CS.pwn(23085) : error 017: undefined symbol "tmp"
gamemodes\CS.pwn(23085) : error 017: undefined symbol "strtok"

linha do erro
tmp = strtok(cmdtext,idx);

isso e falta de include?

#include a_samp.inc
#include a_npc.inc
#include a_http.inc
#include bCini8.inc
#include bCGz.inc
#include streamer.inc
#include mapandreas.inc
Reply
#2

Se for variavel, tem que definilas
Reply
#3

if(strcmp(Comando,"/setpos",true)==0)
{
new plid,Floatetpos[3];
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid, 0xBFBFBFAA, "USE: /setpos [id] [X] [Y] [Z]");
plid = strval(tmp);
for(new x=0;x<3;x++) {
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid, 0xBFBFBFAA, "USE: /setpos [id] [X] [Y] [Z]");
setpos[x] = floatstr(tmp);
}
SetPlayerPos(plid,setpos[0],setpos[1],setpos[2]);
SendClientMessage(playerid, 0xBFBFBFAA, "Posicao setada!");
return 1;
}

estou tentando colocar esse comando na gm preciso muito desse comando
Reply
#4

Creio que o "tmp" nгo estб definido como variavel. Coloque uma "new".
PHP Code:
if(strcmp(Comando,"/setpos",true)==0)
{
new 
plid,Floatetpos[3];
new 
tmp strtok(cmdtext,idx);
if(!
strlen(tmp)) return SendClientMessage(playerid0xBFBFBFAA"USE: /setpos [id] [X] [Y] [Z]");
plid strval(tmp);
for(new 
x=0;x<3;x++) {
tmp strtok(cmdtext,idx);
if(!
strlen(tmp)) return SendClientMessage(playerid0xBFBFBFAA"USE: /setpos [id] [X] [Y] [Z]");
setpos[x] = floatstr(tmp);
}
SetPlayerPos(plid,setpos[0],setpos[1],setpos[2]);
SendClientMessage(playerid0xBFBFBFAA"Posicao setada!");
return 
1;

Reply
#5

Fiz em ZCMD + sscanf
Adapte para o seu GM.

PHP Code:
CMD:setpos(playeridparams[]) {
    new 
id;
    new 
Float:p[3];
    if(
sscanf(params"iiii"idp[0], p[1], p[2])) {
        
SendClientMessage(playerid,-1,"(Erro) Use: /setpos [ID] [X] [Y] [Z]");
    }
    if(
id == INVALID_PLAYER_ID) {
        
SendClientMessage(playerid,-1,"(Erro) ID Invбlido");
    }
    else {
        
SetPlayerPos(id,p[0], p[1], p[2]);
        
SendClientMessage(playerid, -1"*Posiзгo setada com sucesso.");
    }
    return 
1;

Reply
#6

deu 2 erros uma arrumei mais esse aqui como definir ele?
gamemodes\CS.pwn(23086) : error 017: undefined symbol "params"
linha do erro
if(sscanf(params, "iii", p[0], p[1], p[2])) {
Reply
#7

https://sampforum.blast.hk/showthread.php?tid=468180
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)