Teleport works but Server:Unknown Command
#1

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
Reply
#2

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.
Reply
#3


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


Forum Jump:


Users browsing this thread: 1 Guest(s)