SA-MP Forums Archive
Teleport works but Server:Unknown Command - 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: Teleport works but Server:Unknown Command (/showthread.php?tid=109790)



Teleport works but Server:Unknown Command - patchkinson - 22.11.2009

Hey my teleports work just fine, no problemo, but when i teleport a car, it works but displays Server:Unknown Command
HELP!!:
i will show 2 of them cose they are all made the same way
if(!strcmp("/ls", cmdtext, true))
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);
SetVehiclePos(vehicleid,1865.0466,-1378.7865,13.4924);
}
else
{
SetPlayerPos(playerid,1865.0466,-1378.7865,13.4924);
return 1;
}
}
if(!strcmp("/veh", cmdtext, true))
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);
SetVehiclePos(vehicleid,2250.7124,-767.6726,128.6140);
}
else
{
SetPlayerPos(playerid,2250.7124,-767.6726,128.6140);
return 1;
}

And is there a way to change the server unknown command for another message? thanks


Re: Teleport works but Server:Unknown Command - Dark_Kostas - 22.11.2009

Please use
Код:
pawn Код:
your pawn script
tags while you are posting a pawn script.
Now to your problem. Remove the return 1; from the /ls command and add it after the closing bracket so it will be like that.
pawn Код:
if(!strcmp("/ls", cmdtext, true))
{
   if(IsPlayerInAnyVehicle(playerid))
   {
      new vehicleid = GetPlayerVehicleID(playerid);
      SetVehiclePos(vehicleid,1865.0466,-1378.7865,13.4924);
   }
   else
   {
      SetPlayerPos(playerid,1865.0466,-1378.7865,13.4924);
   }
   return 1;
}
At your /veh command, one bracket is missing. Also do the same with the return.
pawn Код:
if(!strcmp("/veh", cmdtext, true))
{
   if(IsPlayerInAnyVehicle(playerid))
   {
      new vehicleid = GetPlayerVehicleID(playerid);
      SetVehiclePos(vehicleid,2250.7124,-767.6726,128.6140);
   }
   else
   {
      SetPlayerPos(playerid,2250.7124,-767.6726,128.6140);
   }
   return 1;
}
Your commands should work now.


Re: Teleport works but Server:Unknown Command - patchkinson - 22.11.2009


Thank you and next time i will use those tags to post PAWN code