19.04.2015, 23:14
Ficou meio grande, mas foi a ъnica forma que consegui pensar
PHP код:
#define TAXISTA 0
#define MOTORISTA 1
enum vinfo
{
Veiculo,
Prof,
}
enum pinfo
{
Prof,
}
new player[MAX_PLAYERS][pinfo];
new veiculo[MAX_VEHICLES][vinfo];
new indice = 0;
CMD:setarveiculo(playerid, params[])
{
if(IsPlayerAdmin(playerid) && IsPlayerInAnyVehicle(playerid))
{
veiculo[indice][Veiculo] = GetPlayerVehicleID(playerid);
veiculo[indice][Prof] = TAXISTA;
indice = indice + 1;
}
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
{
for(new a = 0; a < indice; a++)
{
if(veiculo[a][Veiculo] == GetPlayerVehicleID(playerid) && (veiculo[a][Prof] != player[playerid][Prof]))
{
RemovePlayerFromVehicle(playerid);
break;
}
}
}
}