SA-MP Forums Archive
Quick question - 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: Quick question (/showthread.php?tid=65071)



Quick question - fiordas - 09.02.2009

Hello, let's say there's teleport in my server e.g. /stunt and when player use it he will get teleported, but if he's driving a vehicle he would be teleported to one location (e.g. to stunt park), and if he is on foot he would be teleported to another one (e.g. to vehicles zone). How can i do that?


Re: Quick question - Think - 09.02.2009

Quote:
Originally Posted by fiordas
Hello, let's say there's teleport in my server e.g. /stunt and when player use it he will get teleported, but if he's driving a vehicle he would be teleported to one location (e.g. to stunt park), and if he is on foot he would be teleported to another one (e.g. to vehicles zone). How can i do that?
IsPlayerInAnyVehicle(playerid);


Re: Quick question - SilentMouse - 09.02.2009

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/stunt", cmdtext, true, 10) == 0) {
        if (IsPlayerInAnyVehicle(playerid)) {
            SetPlayerPos(playerid, x,y,z); // In vehicle
        } else {
          SetPlayerPos(playerid, x,y,z); // NOT in vehicle
          }
        return 1;
    }
    return 0;
}
Don't mind the bad indentation.