SA-MP Forums Archive
is player in 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)
+--- Thread: is player in car (/showthread.php?tid=295203)



is player in car - manchestera - 05.11.2011

Hi i would like to know how i can make it that if they choose this list from a dialog they have to be in a car if they car not it sends a message telling them to get in a car first.

Many thanks

Код:
   if(listitem == 0)
{
    SetPlayerRaceCheckpoint(playerid, 0, -1795.0421, 1103.3732, 45.0752, -1930.9707, 1076.5671, 50.9935, 100);
    Sfrace[playerid] = 1; // This will change the variable, so we can use it later on with OnPlayerEnterCheckpoint
	SetPlayerPos(playerid,-1715.7688,1103.5144,45.2969);
    SendClientMessage(playerid, 0xFFFFFFFF, "You Start The San Ferrio Street Race Challange. Please follow the checkpoints");
    Sfracetimer = SetTimer("TimedCountdown", 1000, true);
    return 1;
}



Re: is player in car - Pinguinn - 05.11.2011

pawn Код:
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "You have to be in a vehicle!");



Re: is player in car - manchestera - 05.11.2011

Код:
 if(listitem == 0)
{
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "You have to be in a vehicle!");
    SetPlayerRaceCheckpoint(playerid, 0, -1795.0421, 1103.3732, 45.0752, -1930.9707, 1076.5671, 50.9935, 100);
    Sfrace[playerid] = 1; // This will change the variable, so we can use it later on with OnPlayerEnterCheckpoint
	SetPlayerPos(playerid,-1715.7688,1103.5144,45.2969);
    SendClientMessage(playerid, 0xFFFFFFFF, "You Start The San Ferrio Street Race Challange. Please follow the checkpoints");
    Sfracetimer = SetTimer("TimedCountdown", 1000, true);
    return 1;
}
so just like that?


Re: is player in car - sleepysnowflake - 05.11.2011

Yes. Just like that.


Re: is player in car - manchestera - 05.11.2011

edited DOne it thanks everyonefor your help and ive reped who it will let me rep.


Re: is player in car - FTLOG - 05.11.2011

SetVehiclePos(GetPlayerVehicleID(playerid),-1715.7688,1103.5144,45.2969);