SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 05/07/2020, 04:03 PM   #1
Aranha
Banned
 
Join Date: Nov 2018
Posts: 93
Reputation: 1
Default erro compilar

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
Aranha is offline   Reply With Quote
Old 05/07/2020, 04:06 PM   #2
k2bi
Big Clucker
 
k2bi's Avatar
 
Join Date: Sep 2017
Location: Novo Horizonte - SP
Posts: 186
Reputation: 5
Default Re: erro compilar

Se for variavel, tem que definilas
k2bi is offline   Reply With Quote
Old 05/07/2020, 04:09 PM   #3
Aranha
Banned
 
Join Date: Nov 2018
Posts: 93
Reputation: 1
Default Re: erro compilar

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
Aranha is offline   Reply With Quote
Old 05/07/2020, 04:13 PM   #4
k2bi
Big Clucker
 
k2bi's Avatar
 
Join Date: Sep 2017
Location: Novo Horizonte - SP
Posts: 186
Reputation: 5
Default Re: erro compilar

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;

k2bi is offline   Reply With Quote
Old 05/07/2020, 04:18 PM   #5
Sants
Big Clucker
 
Sants's Avatar
 
Join Date: May 2019
Location: Brasília, Brazil
Posts: 125
Reputation: 6
Default Re: erro compilar

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;

__________________
Disponivel para programar
Mais informações em:
Discord - Sants#1462
PAWN (Intermediary) - JS (Beginer)

Last edited by Sants; 06/07/2020 at 01:38 AM.
Sants is offline   Reply With Quote
Old 05/07/2020, 04:27 PM   #6
Aranha
Banned
 
Join Date: Nov 2018
Posts: 93
Reputation: 1
Default Re: erro compilar

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])) {
Aranha is offline   Reply With Quote
Old 06/07/2020, 12:31 AM   #7
ipsLuan
High-roller
 
ipsLuan's Avatar
 
Join Date: Feb 2013
Location: Ilhéus, BA
Posts: 4,561
Reputation: 332
Default Re: erro compilar

https://forum.sa-mp.com/showthread.php?t=468180
__________________

Precisando de algum sistema? Chame!

ipsLuan is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ajuda] Erro ao compilar! Murillo Português/Portuguese 8 17/07/2014 01:33 AM
[Ajuda] Erro a compilar NtkGames Português/Portuguese 9 02/06/2014 11:51 PM
Erro no compilar brunoboy Português/Portuguese 9 21/07/2012 10:12 PM
[ERRO]Erro na hora de compilar lawl_d2d Português/Portuguese 4 13/03/2010 04:25 PM
[ERRO]Erro na hora de compilar riad12 Português/Portuguese 11 13/02/2010 05:41 PM


All times are GMT. The time now is 07:52 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.