How would I do this?(If get player state)
#1

pawn Код:
if(GetPlayerState(playerid) == !PLAYER_STATE_DRIVER))
You get errors of target mismatch?

How do I fix this?

To do, If player is not in a vehicle, Sendclientmessage, You are not in a vehicle!!
Reply
#2

pawn Код:
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER))
{
    SendClientMessage(playerid, -1, "ERROR: You are not in a vehicle!");
    return 1;
}
Reply
#3

pawn Код:
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)

EDIT:

Quote:
Originally Posted by kirollos
Посмотреть сообщение
pawn Код:
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER))
{
    SendClientMessage(playerid, -1, "ERROR: You are not in a vehicle!");
    return 1;
}
You don't need to keep those 2 braces.
Reply
#4

How would I do

I get error.

if(!IsPlayerInVehicle(playerid))
Reply
#5

if(!IsPlayerInAnyVehicle(playerid));
or
if(IsPlayerInVehicle(playerid,vehicleid));
Reply
#6

I think you want to check if the player is not in any vehicle not in a specified vehicleid.

pawn Код:
if(!IsPlayerInAnyVehicle(playerid))
you can also take a look on those pages above

https://sampwiki.blast.hk/wiki/Function:IsPlayerInVehicle
https://sampwiki.blast.hk/wiki/IsPlayerInAnyVehicle

EDIT: too late as always
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)