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
}