17.12.2014, 22:11
Well i created an /flock to lock the faction cars but there is a problem
When you are in the same faction it keeps saying You can't use this command whats the problem?
When you are in the same faction it keeps saying You can't use this command whats the problem?
pawn Код:
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;
}