Сигнализация любого автомобиля в котором сидишь....
Можете под себя дополнить как хотите...
Code
new gvhichelealarm[MAX_PLAYERS];
new Alarm[255]; // Vehicle Alarm
в public OnPlayerStateChange(playerid, newstate, oldstate)
Code
if(newstate == 2)
{
new v = GetPlayerVehicleID(playerid);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(PlayerInfo[i][vehicle] == v && Alarm[v] == 1)
{
GameTextForPlayer(playerid,"~r~Alarm System ~g~Activated",1000,1);
SendClientMessage(playerid,COLOR_GREY,"* This vehicle has an active lock system and cannot be used.");
RemovePlayerFromVehicle(playerid);
return 1;
}
PlayerInfo[playerid][vehicle] = GetPlayerVehicleID(playerid);
}
}
в public OnPlayerCommandText
Code
if(strcmp(cmd,"/alarm",true)==0)
{
if (gvhichelealarm[playerid] == 0)
{
if(PlayerInfo[playerid][vehicle] == 0)
{
SendClientMessage(playerid,COLOR_GREY," You must have been in a car to lock it.");
return 1;
}
if(GetPlayerState(playerid) == 2)
{
SendClientMessage(playerid,COLOR_GREY," You must be outside of the car to lock it.");
return 1;
}
new Vehicle = PlayerInfo[playerid][vehicle];
Alarm[Vehicle] = 1;
SendClientMessage(playerid,COLOR_GREEN,"* Your vehicle is now locked and the alarm system is on.");
PlayerPlaySound(playerid,1147,0,0,0);
gvhichelealarm[playerid]=1;
return 1;
}
if (gvhichelealarm[playerid] == 1)
{
if(PlayerInfo[playerid][vehicle] == 0)
{
SendClientMessage(playerid,COLOR_GREY," You must have been in a car to lock it.");
return 1;
}
new Vehicle = PlayerInfo[playerid][vehicle];
Alarm[Vehicle] = 0;
SendClientMessage(playerid,COLOR_GREEN,"* Your vehicle is now unlocked and the alarm system is off.");
PlayerPlaySound(playerid,1147,0,0,0);
gvhichelealarm[playerid]=0;
return 1;
}
return 1;
}