CMD:svetla(playerid,params[])
{
new string[128];
new engine,lights,alarm,doors,bonnet,boot,objective;
if(IsPlayerInAnyVehicle(playerid))
{
if(Lights[playerid] == 0)
{
format(string, sizeof(string), "%s turns the lights on", RemoveUnderScore(playerid));
SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 10.0, 5000);
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_INFO, "[!]{FFFFFF} You turned the lights on");
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, 1 , alarm , doors, bonnet, boot, objective);
Lights[playerid] = 1;
}
else
{
format(string, sizeof(string), "%s turns the lights off.", RemoveUnderScore(playerid));
SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 10.0, 5000);
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_INFO, "[!]{FFFFFF} You turned off the lights");
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine , lights , alarm , doors , bonnet , boot , objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine , 0 , alarm , doors , bonnet , boot , objective);
Lights[playerid] = 0;
}
}
return 1;
}
if(lights)
{
if(Lights[playerid] == 0)
{
|
use
Код:
if(lights)
{
Код:
if(Lights[playerid] == 0)
{
|
Lights[carid] // To store this for a car not for a player