02.02.2017, 01:24
Nesse comando desejo fazer que, ao digitar /ligar uma vez o veнculo ligue, outra vez o veнculo desligue. Como posso obter isso? Poderia me exemplificar fazendo a funзгo e explicando pra que serve cada coisa?
Segunda dъvida do mesmo cуdigo:
Queria colocar algumas falhas, tipo "Thug tenta mas nгo consegue ligar o veнculo" mais uma vez, "Thug liga o veнculo" uma espйcie de Randoms dentro do comando. Cб estб ele:
Segunda dъvida do mesmo cуdigo:
Queria colocar algumas falhas, tipo "Thug tenta mas nгo consegue ligar o veнculo" mais uma vez, "Thug liga o veнculo" uma espйcie de Randoms dentro do comando. Cб estб ele:
Код:
if (strcmp("/motor", cmdtext, true, 10) == 0)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
if(!IsPlayerInAnyVehicle(playerid))
return SendClientMessage(playerid, COR_LARANJA,"Й necessбrio que esteja em um veнculo para liga-lo.");
new vid = GetPlayerVehicleID(playerid);
new Float:vidacarro;
GetVehicleHealth(GetPlayerVehicleID(playerid),vidacarro);
if(IsPlayerNPC(playerid))
{
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
return 0x01;
}
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 0x01;
}
if(vid != INVALID_VEHICLE_ID)
{
if(pInfo[playerid][Logado] == true)
{
format(string, sizeof(string), "* %s insire a chave na igniзгo e liga o motor.", GetName(playerid, true));
}
ProxDetector(10.0, playerid, string, COLOR_PURPLE);
TogglePlayerControllable(playerid, true);
SetVehicleEngineOn(vid);
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
}
return 1;
}

