05.03.2014, 11:00
Como o schocc jб disse estuda variaveis no entanto vou dar um exemplo!
pawn Код:
new SWAT[MAX_VEHICLES];
forward IsSWATVehicle(vehicleid);
public OnGameModeInit()
{
SWAT[0] = AddStaticVehicleEx(601,894.5000000,-2640.3990000,14.3000000,0.0000000,245,245,15); // cria o carro da swat
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
if(IsSWATVehicle(vehicleid)) // Usa a funзгo criada para verificar se й da swat ou nгo
{
SendClientMessage(playerid, -1, "Vecк entrou num veiculo da SWAT!")
}
}
return 1;
}
public IsSWATVehicle(vehicleid) //Funзгo para verificar se o carro й da swat
{
for(new i = 0; i < sizeof(SWAT); i++)
{
if(vehicleid == SWAT[i]) return 1;
}
return 0;
}