Condition car help
#2

Well you can initialize those vars to "INVALID_VEHICLE_ID", then check their value.

pawn Код:
//OnPlayerConnect
PlayerData[playerid][pPcarkey]  = INVALID_VEHICLE_ID;
PlayerData[playerid][pPcarkey2] = INVALID_VEHICLE_ID;
PlayerData[playerid][pPcarkey3] = INVALID_VEHICLE_ID;

//when your giving the player a vehicle
if( PlayerData[playerid][pPcarkey] == INVALID_VEHICLE_ID )
{
    //player doesn't have a vehice in this slot
    PlayerData[playerid][pPcarkey] = 420;//give a vehicle
   
}
else if( PlayerData[playerid][pPcarkey2] == INVALID_VEHICLE_ID )
{
    //player doesn't have a vehice in this slot
    PlayerData[playerid][pPcarkey2] = 425;
}
else if( PlayerData[playerid][pPcarkey3] == INVALID_VEHICLE_ID )
{
    //player doesn't have a vehice in this slot
    PlayerData[playerid][pPcarkey3] = 200;
}
else
{
    //player has a vehicle in all slots
}
There are other ways to do it, but this is the simplest i can think of. Not sure why you used "targetid" as well as "playerid".
Reply


Messages In This Thread
Condition car help - by Johnnny - 16.07.2013, 07:55
Re: Condition car help - by iggy1 - 16.07.2013, 09:18

Forum Jump:


Users browsing this thread: 1 Guest(s)