24.04.2018, 17:51
Fiz assim
Ficou grande e eu acho que estou desperdiзando espaзo. Mas estб funcionado.
PHP код:
new Eveiculo[5];
new Emotoboy[4];
PHP код:
public OnGameModeInit()
{
UsePlayerPedAnims(); // Andar normalmente
Eveiculo[0] = AddStaticVehicle(578,-148.1839,-322.7406,2.0453,180.2084,1,1); // v1
Eveiculo[1] = AddStaticVehicle(578,-141.2557,-322.8502,2.0457,178.6352,1,1); // v2
Eveiculo[2] = AddStaticVehicle(578,-133.7400,-322.4712,2.0464,180.6215,1,1); // v3
Eveiculo[3] = AddStaticVehicle(578,-125.7944,-322.5229,2.0460,178.9929,1,1); // v4
Eveiculo[4] = AddStaticVehicle(578,-116.7708,-322.5246,2.0518,177.9242,1,1); // v5
// --
Emotoboy[0] = AddStaticVehicle(448,2097.9995,-1812.6289,12.9820,90.5790,3,6); // pizza1
Emotoboy[1] = AddStaticVehicle(448,2097.5234,-1814.4313,12.9817,89.5149,3,6); // pizza2
Emotoboy[2] = AddStaticVehicle(448,2097.7832,-1801.9897,12.9825,91.2709,3,6); // pizza3
Emotoboy[3] = AddStaticVehicle(448,2098.0776,-1800.4216,12.9854,91.9463,3,6); // pizza4
return 1;
}
PHP код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new arquivo[40], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(arquivo, sizeof(arquivo),"Contas/%sInfos.ini", name);
Player[playerid][pEmprego] = DOF2_GetInt(arquivo, "Emprego");
if(newstate == PLAYER_STATE_DRIVER)
{
for(new i; i < sizeof(Eveiculo); i++)
{
if(GetPlayerVehicleID(playerid) == Eveiculo[i])
{
if(Player[playerid][pEmprego] == 1)
{
SendClientMessage(playerid, -1, "[CLS]Digite /t para comeзar a trabalhar");
}else{
SendClientMessage(playerid, -1, "[CLS]Esse veнculo й apenas para Caminhoneiros");
RemovePlayerFromVehicle(playerid);
}
}
}
for(new p; p < sizeof(Emotoboy); p++)
{
if(GetPlayerVehicleID(playerid) == Emotoboy[p])
{
if(Player[playerid][pEmprego] != 2)
{
SendClientMessage(playerid, -1, "[CLS]Esse veнculo й apenas para MotoBoys");
RemovePlayerFromVehicle(playerid);
ClearAnimations(playerid);
}else{
SendClientMessage(playerid, -1, "[CLS]Digite /t para comeзar a trabalhar");
}
}
}
}
return 1;
}