SA-MP Forums Archive
Error [pawn comp] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Error [pawn comp] (/showthread.php?tid=649571)



Error [pawn comp] - EvgeniyHostel1992 - 11.02.2018

help pls
PHP код:
if(strcmp(cmd"/gotohouse"true) == 0)
     {
       if(
pl[playerid][pAdmin]==0)return 1;
       
tmp strtok(cmdtext,idx);
      new 
housenum strval(tmp);
      if(!
strlen(tmp))return send(playeridCOLOR_GRAD2"USAGE: /gotohouse [housenumber]");
      
SetPlayerInterior(playerid,hl[housenum][hInt]);
      
SetPlayerVirtualWorld(playerid,hl[housenum][hWorld]);
      
SetPlayerPos(playerid,hl[housenum][hExitx],hl[hl][hExity],hl[housenum][hExitz]);
     } 
PHP код:
error 017undefined symbol "tmp"
error 017undefined symbol "strtok" 



Re: Error [pawn comp] - Gameluner - 11.02.2018

Use IZcmd.
Код:
#include izcmd
CMD:gotohouse(p,params[])
{
      if(pl[playerid][pAdmin]==0) return 1;
      if(!strval(params)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /gotohouse [housenumber]");
      SetPlayerInterior(playerid,hl[housenum][hInt]);
      SetPlayerVirtualWorld(playerid,hl[housenum][hWorld]);
      SetPlayerPos(playerid,hl[housenum][hExitx],hl[hl][hExity],hl[housenum][hExitz]);
}
This should work.


Re: Error [pawn comp] - Mugala - 11.02.2018

yeah use ZCMD or YCMD atleast, this kind of command is too old-fashioned and it's hard to operate with that.


Re: Error [pawn comp] - EvgeniyHostel1992 - 11.02.2018

thank you! =* Gameluner