CMD:flock(playerid, params[])
{
new string[128], idx, lockdone;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pFac] == 1) return SendClientMessage(playerid, COLOR_GREY, "You can't use that command.");
if(GetPlayerVehicleID(playerid) == FacInfo[1][fCars])
{
new Float:vx, Float:vy, Float:vz;
GetVehiclePos(GetPlayerVehicleID(playerid) == FacInfo[1][fCars], vx, vy, vz);
if(IsPlayerInRangeOfPoint(playerid, 3, vx, vy, vz))
{
idx = GetPlayerVehicleID(playerid) == FacInfo[1][fCars];
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, boot, objective);
if(doors)
{
SetVehicleParamsEx(idx, engine, lights, alarm, 0, bonnet, boot, objective);
LSPDcar[playerid] = 0;
format(string, sizeof(string), "* %s takes out their vehicle keys and unlocks it.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
GameTextForPlayer(playerid, "~g~Vehicle Unlocked", 3500, 3);
}
else
{
SetVehicleParamsEx(idx, engine, lights, alarm, 1, bonnet, boot, objective);
LSPDcar[playerid] = 1;
format(string, sizeof(string), "* %s takes out their vehicle keys and locks it.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
GameTextForPlayer(playerid, "~r~Vehicle Locked", 3500, 3);
}
lockdone = 1;
return 1;
}
GetVehiclePos(GetPlayerVehicleID(playerid) == FacInfo[1][fCars], vx, vy, vz);
if(IsPlayerInRangeOfPoint(playerid, 3, vx, vy, vz))
{
idx = PlayerInfo[playerid][pVVeh];
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, boot, objective);
if(doors)
{
SetVehicleParamsEx(idx, engine, lights, alarm, 0, bonnet, boot, objective);
LSPDcar[playerid] = 0;
format(string, sizeof(string), "* %s takes out their vehicle keys and unlocks it.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
GameTextForPlayer(playerid, "~g~Vehicle Unlocked", 3500, 3);
}
else
{
SetVehicleParamsEx(idx, engine, lights, alarm, 1, bonnet, boot, objective);
LSPDcar[playerid] = 1;
format(string, sizeof(string), "* %s takes out their vehicle keys and locks it.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
GameTextForPlayer(playerid, "~r~Vehicle Locked", 3500, 3);
}
lockdone = 1;
}
return 1;
}
if(!lockdone)
{
SendClientMessage(playerid, COLOR_GREY, "You are not near something you can lock/unlock.");
}
return 1;
}
CMD:flock(playerid, params[])
{
new string[128], idx, lockdone;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!PlayerInfo[playerid][pFac] == 1) return SendClientMessage(playerid, COLOR_GREY, "You can't use that command.");
if(GetPlayerVehicleID(playerid) == FacInfo[1][fCars])
{
new Float:vx, Float:vy, Float:vz;
GetVehiclePos(GetPlayerVehicleID(playerid) == FacInfo[1][fCars], vx, vy, vz);
if(IsPlayerInRangeOfPoint(playerid, 3, vx, vy, vz))
{
idx = GetPlayerVehicleID(playerid) == FacInfo[1][fCars];
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, boot, objective);
if(doors)
{
SetVehicleParamsEx(idx, engine, lights, alarm, 0, bonnet, boot, objective);
LSPDcar[playerid] = 0;
format(string, sizeof(string), "* %s takes out their vehicle keys and unlocks it.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
GameTextForPlayer(playerid, "~g~Vehicle Unlocked", 3500, 3);
}
else
{
SetVehicleParamsEx(idx, engine, lights, alarm, 1, bonnet, boot, objective);
LSPDcar[playerid] = 1;
format(string, sizeof(string), "* %s takes out their vehicle keys and locks it.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
GameTextForPlayer(playerid, "~r~Vehicle Locked", 3500, 3);
}
lockdone = 1;
return 1;
}
GetVehiclePos(GetPlayerVehicleID(playerid) == FacInfo[1][fCars], vx, vy, vz);
if(IsPlayerInRangeOfPoint(playerid, 3, vx, vy, vz))
{
idx = PlayerInfo[playerid][pVVeh];
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, boot, objective);
if(doors)
{
SetVehicleParamsEx(idx, engine, lights, alarm, 0, bonnet, boot, objective);
LSPDcar[playerid] = 0;
format(string, sizeof(string), "* %s takes out their vehicle keys and unlocks it.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
GameTextForPlayer(playerid, "~g~Vehicle Unlocked", 3500, 3);
}
else
{
SetVehicleParamsEx(idx, engine, lights, alarm, 1, bonnet, boot, objective);
LSPDcar[playerid] = 1;
format(string, sizeof(string), "* %s takes out their vehicle keys and locks it.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
GameTextForPlayer(playerid, "~r~Vehicle Locked", 3500, 3);
}
lockdone = 1;
}
return 1;
}
if(!lockdone)
{
SendClientMessage(playerid, COLOR_GREY, "You are not near something you can lock/unlock.");
}
return 1;
}
|
You opened your line into saying if(Pfaction == 1) return SCM etc
That line indicates that if the player is in that faction show them that msg You need to add a '!' to set it as a negative Fixed Code: Код:
CMD:flock(playerid, params[])
{
new string[128], idx, lockdone;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!PlayerInfo[playerid][pFac] == 1) return SendClientMessage(playerid, COLOR_GREY, "You can't use that command.");
if(GetPlayerVehicleID(playerid) == FacInfo[1][fCars])
{
new Float:vx, Float:vy, Float:vz;
GetVehiclePos(GetPlayerVehicleID(playerid) == FacInfo[1][fCars], vx, vy, vz);
if(IsPlayerInRangeOfPoint(playerid, 3, vx, vy, vz))
{
idx = GetPlayerVehicleID(playerid) == FacInfo[1][fCars];
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, boot, objective);
if(doors)
{
SetVehicleParamsEx(idx, engine, lights, alarm, 0, bonnet, boot, objective);
LSPDcar[playerid] = 0;
format(string, sizeof(string), "* %s takes out their vehicle keys and unlocks it.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
GameTextForPlayer(playerid, "~g~Vehicle Unlocked", 3500, 3);
}
else
{
SetVehicleParamsEx(idx, engine, lights, alarm, 1, bonnet, boot, objective);
LSPDcar[playerid] = 1;
format(string, sizeof(string), "* %s takes out their vehicle keys and locks it.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
GameTextForPlayer(playerid, "~r~Vehicle Locked", 3500, 3);
}
lockdone = 1;
return 1;
}
GetVehiclePos(GetPlayerVehicleID(playerid) == FacInfo[1][fCars], vx, vy, vz);
if(IsPlayerInRangeOfPoint(playerid, 3, vx, vy, vz))
{
idx = PlayerInfo[playerid][pVVeh];
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, boot, objective);
if(doors)
{
SetVehicleParamsEx(idx, engine, lights, alarm, 0, bonnet, boot, objective);
LSPDcar[playerid] = 0;
format(string, sizeof(string), "* %s takes out their vehicle keys and unlocks it.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
GameTextForPlayer(playerid, "~g~Vehicle Unlocked", 3500, 3);
}
else
{
SetVehicleParamsEx(idx, engine, lights, alarm, 1, bonnet, boot, objective);
LSPDcar[playerid] = 1;
format(string, sizeof(string), "* %s takes out their vehicle keys and locks it.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
GameTextForPlayer(playerid, "~r~Vehicle Locked", 3500, 3);
}
lockdone = 1;
}
return 1;
}
if(!lockdone)
{
SendClientMessage(playerid, COLOR_GREY, "You are not near something you can lock/unlock.");
}
return 1;
}
|