SA-MP Forums Archive
about my teleport's code - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: about my teleport's code (/showthread.php?tid=92562)



about my teleport's code - Sfinx_17 - 20.08.2009

if (strcmp("/teleport", cmdtext, true, 10) == 0)
{
SetPlayerInterior(playerid,11);
SetPlayerPos(playerid, 508.7362, -87.4335, 998.9609);
return true;
}

////////////////////////////////////////////////////////////////////////////////////////////



if (strcmp("/teleportgrua", cmdtext, true, 10) == 0)
{
SetPlayerInterior(playerid,11);
SetPlayerPos(playerid, 2399.2263,1926.4996,76.3745);
return true;
}

ok now what is the problem with my script for teleporting ?
first code that with "/teleport" works...ok but why the other code with that "/teleportgrua" doesn't work ?
please i need help here ...i don't know what is the problem is the problem with the interiorid or what please i need a good code to work can anybody help me please?


Re: about my teleport's code - Jefff - 20.08.2009

Код:
if (strcmp("/teleportgrua", cmdtext, true, 13) == 0)
{
   SetPlayerInterior(playerid,11);
   SetPlayerPos(playerid, 2399.2263,1926.4996,76.3745);
   return true;
}



Re: about my teleport's code - Sfinx_17 - 21.08.2009

you change onlythat true to 13? what means that ...


Re: about my teleport's code - dice7 - 21.08.2009

pawn Код:
if (strcmp("/teleportgrua", cmdtext, true, 13) == 0)
if 'true' is set, then strcmp will check if the letters are also capital or not. Basiclly, It's not kinda useful
And '13' is the lenght of the strings. They need to be the same lenght for strcmp to succesed