Detecting if a player is in their owned vehicle REP+
#17

Quote:
Originally Posted by Azzeto
Посмотреть сообщение
Heres my /savemycar cmd, but it doesn't work when I add if(GetPlayerVehicleID blah blah)
pawn Код:
CMD:savemycar(playerid,params[])
{
    new Float:cp[4];
    if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][Vehicle])
    {
        GetPlayerPos(playerid,cp[0],cp[1],cp[2]);
        PlayerInfo[playerid][CarX] = cp[0];
        PlayerInfo[playerid][CarY] = cp[1];
        PlayerInfo[playerid][CarZ] = cp[2];
        PlayerInfo[playerid][CarA] = cp[3];
        SendClientMessage(playerid,COLOR_GRAY,">> Vehicle Saved");
    }
    return 1;
}
Why?
Because PlayerInfo[playerid][Vehicle] stores the model of the vehicle and not the id.
pawn Код:
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == PlayerInfo[playerid][Vehicle])
{
    //code
}
Reply


Messages In This Thread
Detecting if a player is in their owned vehicle REP+ - by Azzeto - 30.01.2012, 10:38
Re: Detecting if a player is in their owned vehicle REP+ - by milanosie - 30.01.2012, 10:39
Re: Detecting if a player is in their owned vehicle REP+ - by Azzeto - 30.01.2012, 10:40
Re: Detecting if a player is in their owned vehicle REP+ - by milanosie - 30.01.2012, 10:43
Re: Detecting if a player is in their owned vehicle REP+ - by milanosie - 30.01.2012, 10:46
Re: Detecting if a player is in their owned vehicle REP+ - by Azzeto - 30.01.2012, 10:48
Re: Detecting if a player is in their owned vehicle REP+ - by milanosie - 30.01.2012, 10:55
Re: Detecting if a player is in their owned vehicle REP+ - by Azzeto - 30.01.2012, 10:56
Re: Detecting if a player is in their owned vehicle REP+ - by Unte99 - 30.01.2012, 11:12
Re: Detecting if a player is in their owned vehicle REP+ - by DRIFT_HUNTER - 30.01.2012, 11:35
Re: Detecting if a player is in their owned vehicle REP+ - by Azzeto - 30.01.2012, 20:55
Re: Detecting if a player is in their owned vehicle REP+ - by Azzeto - 01.02.2012, 04:01
Re: Detecting if a player is in their owned vehicle REP+ - by Azzeto - 02.02.2012, 19:08
Re: Detecting if a player is in their owned vehicle REP+ - by milanosie - 02.02.2012, 19:18
Re: Detecting if a player is in their owned vehicle REP+ - by Azzeto - 02.02.2012, 19:32
Re: Detecting if a player is in their owned vehicle REP+ - by milanosie - 02.02.2012, 19:37
Re: Detecting if a player is in their owned vehicle REP+ - by Fj0rtizFredde - 02.02.2012, 19:38
Re: Detecting if a player is in their owned vehicle REP+ - by milanosie - 02.02.2012, 19:39
Re: Detecting if a player is in their owned vehicle REP+ - by Azzeto - 02.02.2012, 19:42

Forum Jump:


Users browsing this thread: 1 Guest(s)