Copfix help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Copfix help (
/showthread.php?tid=555480)
Copfix help -
Alex_T - 07.01.2015
It keeps returning with You are not near your locker.
pawn Код:
CMD:copfix(playerid, params[])
{
new string[256], playerb;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(sscanf(params,"u",playerb)) return SendClientMessage(playerid, USAGE, "[Usage]: /copfix [playerid]");
if(CopFix[playerb] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "You have removed the players ability to acess his locker.");
SendClientMessage(playerb, COLOR_GREY, "You are no longer able to /copfix");
CopFix[playerb] = 0;
format(string, sizeof(string), "AdmWarn: %s has copfixed %s he is %d.", RPN(playerid), RPN(playerb), CopFix[playerb]);
SendAdminMessage(COLOR_DARKRED, 1, string);
return 1;
}
else if(CopFix[playerb] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "Remeber to /copfix again.");
SendClientMessage(playerb, COLOR_GREY, "You have been copfixed by an administrator.");
format(string, sizeof(string), "AdmWarn: %s has copfixed %s.", RPN(playerid), RPN(playerb));
SendAdminMessage(COLOR_DARKRED, 1, string);
CopFix[playerb] = 1;
format(string, sizeof(string), "AdmWarn: %s has copfixed %s he is %d.", RPN(playerid), RPN(playerb), CopFix[playerb]);
SendAdminMessage(COLOR_DARKRED, 1, string);
return 1;
}
return 1;
}
CMD:locker(playerid, params[])
{
new string[256];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(IsACop(playerid))
{
if(!IsPlayerInRangeOfPoint(playerid, 3,256.2174,77.3295,1004.0344) || !CopFix[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "You aren't near your locker.");
SSSShowDialog(playerid, 5);
}
Re: Copfix help -
Sid_Alexander - 07.01.2015
Use this and tell me if it works.
pawn Код:
CMD:locker(playerid, params[])
{
new string[256];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(IsACop(playerid))
{
if(IsPlayerInRangeOfPoint(playerid, 3,256.2174,77.3295,1004.0344))
{
if(CopFix[playerid] == 0)
{
SSSShowDialog(playerid, 5);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You aren't near your locker.");
}
return 1;
}
Re: Copfix help -
Alex_T - 07.01.2015
Still getting same problem.
Re: Copfix help -
Sid_Alexander - 07.01.2015
Recheck the co-ordinates of the position if they're correct or not, I simply increased the radius,
Try this:
pawn Код:
CMD:locker(playerid, params[])
{
new string[256];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(IsACop(playerid))
{
if(IsPlayerInRangeOfPoint(playerid, 8.0, 256.2174, 77.3295, 1004.0344))
{
if(CopFix[playerid] == 0)
{
SSSShowDialog(playerid, 5);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You aren't near your locker.");
}
return 1;
}
Re: Copfix help -
Alex_T - 07.01.2015
The code I want. Is so if a person is in that range or is set to CopFix == 1 then can use /locker
Re: Copfix help -
Alex_T - 07.01.2015
Fixed