Quick question
#1

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

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);
Reply
#3

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


Forum Jump:


Users browsing this thread: 1 Guest(s)