SA-MP Forums Archive
need a command to exit a car - 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: need a command to exit a car (/showthread.php?tid=79386)



need a command to exit a car - myandyou - 28.05.2009

like /exit need it because i most of the time stuck in a car who can help me?



Re: need a command to exit a car - member - 28.05.2009

make a /exit command and use RemovePlayerFromVehicle
https://sampwiki.blast.hk/wiki/RemovePlayerFromVehicle
should work.


Re: need a command to exit a car - Jakku - 28.05.2009

pawn Код:
else if (streq(cmd,"/exit")) {
      new text[256];
      RemovePlayerFromVehicle(playerid);
      format(text,sizeof text,"You exited from your vehicle!");
      SendClientMessagel(playerid,COLOR_COLOR);
      return 1;
      }



Re: need a command to exit a car - Gappy - 28.05.2009

And because you get frozen, TogglePlayerControllable may be helpful


Re: need a command to exit a car - mannu - 28.05.2009

Код:
if(strcmp(cmdtext, "/exit", true) == 0)
{
RemovePlayerFromVehicle(playerid);
}
this shld work




Re: need a command to exit a car - myandyou - 28.05.2009

thank yo al i love you guys

topic closed :P


Re: need a command to exit a car - [eLg]Timmy - 28.05.2009

Quote:
Originally Posted by Jakku
pawn Код:
else if (streq(cmd,"/exit")) {
      new text[256];
      RemovePlayerFromVehicle(playerid);
      format(text,sizeof text,"You exited from your vehicle!");
      SendClientMessagel(playerid,COLOR_COLOR);
      return 1;
      }
Fail, why make a variable with 256 cells?! format is useless too...
Do you even know the player has defined cmd?
pawn Код:
if(!strcmp(cmdtext,"/exit",true)){
  if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFAA, "You aren't in a vehicle!");
  RemovePlayerFromVehicle(playerid);
  TogglePlayerControllable(playerid, true); // if frozen
  return SendClientMessage(playerid, 0xFFFFFFAA, "Your Text");
}