12.02.2014, 12:32
i need a car remote lock textdraw with Lock And Unlock button if somebody go to their car when the lock is on the car trun on the light then turn off like real :P and left them exit the car
new bool:LockVeh[MAX_PLAYERS];
if(newstate == 2)
{
if(LockVeh[playerid] == true)
{
GameTextForPlayer(playerid, "~g~Vehicle Unlocked. Use /lock to lock it.", 5000, 5);
SendClientMessage(playerid,yellow,"Vehicle unlocked.Use /lock to lock it.");
LockVeh[playerid] = false;
}
CMD:lock(playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFFFFFFAA,"You have to be inside a vehicle.");
if(PlayerInfo[playerid][pJailed] == 1) return SendClientMessage(playerid, red, "You cannot use this command in jail.");
if(LockVeh[playerid] == false)
{
GameTextForPlayer(playerid, "~r~Vehicle Locked. Use again /lock to unlock it.", 5000, 5);
SendClientMessage(playerid,yellow,"Vehicle locked.Use again /lock to unlock it.");
RemovePlayerFromVehicle(playerid);
LockVeh[playerid] = true;
for(new i=0; i < MAX_PLAYERS; i++)
{
if(i == playerid) continue;
{
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,1);
}
}
}
else
{
GameTextForPlayer(playerid, "~g~Vehicle Unlocked. Use /lock to lock it.", 5000, 5);
SendClientMessage(playerid,yellow,"Vehicle unlocked.Use /lock to lock it.");
LockVeh[playerid] = false;
for(new i=0; i < MAX_PLAYERS; i++)
{
if(i == playerid) continue;
{
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,0);
}
}
}
return 1;
}