23.03.2014, 09:13
Quote:
Why don't you explain to him why?
The first method is definately not the way to do things. In fact, you don't really need a variable at all, just do this if you only need it once: pawn Код:
|
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
#define vehicle GetPlayerVehicleID(playerid)
if(vehicle == Player[playerid][pCar]) SendClientMessage(playerid, "It's your vehicle");
// codes to be used with vehicle
#undef vehicle
}
return 1;
}
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new vehicle GetPlayerVehicleID(playerid)
if(vehicle == Player[playerid][pCar]) SendClientMessage(playerid, "It's your vehicle");
// codes to be used with vehicle
}
return 1;
}