Help with Multiple points to a /duty - 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: Help with Multiple points to a /duty (
/showthread.php?tid=398119)
Help with Multiple points to a /duty -
jakejohnsonusa - 08.12.2012
Here is what I have for the Firefighter faction duty command. The problem is, is that only the first point is working as a duty point. What did I do wrong? How can I fix it so both points are duty points for the /duty command?
/duty code for firefighters:
pawn Код:
else if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12)
{
if(!IsPlayerInRangeOfPoint(playerid, 3.0, 2811.7837,-1167.3248,1025.5703) || IsPlayerInRangeOfPoint(playerid, 3.0, 1924.24,-1876.71,12.94))
{
SendClientMessage(playerid, COLOR_GRAD1, "You are not at the Firemen Lockers!");
return 1;
}
if(JobDuty[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "* You are now Off Duty from your Firemen Job and will not receive calls anymore.");
JobDuty[playerid] = 0;
SetPlayerColor(playerid, TEAM_HIT_COLOR);
SafeResetPlayerWeapons(playerid);
new originalskin = PlayerInfo[playerid][pModel];
SetPlayerSkin(playerid, originalskin);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "* You are now On Duty with your Firemen Job and will receive calls from people in need.");
JobDuty[playerid] = 1;
SetPlayerColor(playerid, 0xAA333300);
SafeGivePlayerWeapon(playerid, 42, 2500);
SafeGivePlayerWeapon(playerid, 6, 1);
new rand = random(2)//change it to the number of skins you want
switch(rand)
{
case 0: SetPlayerSkin(playerid, 277);
case 1: SetPlayerSkin(playerid, 278);
}
}
}
Re: Help with Multiple points to a /duty -
Threshold - 08.12.2012
Shouldn't
pawn Код:
IsPlayerInRangeOfPoint(playerid, 3.0, 1924.24,-1876.71,12.94)
be:
pawn Код:
!IsPlayerInRangeOfPoint(playerid, 3.0, 1924.24,-1876.71,12.94)
??
pawn Код:
if(!IsPlayerInRangeOfPoint(playerid, 3.0, 2811.7837,-1167.3248,1025.5703) || !IsPlayerInRangeOfPoint(playerid, 3.0, 1924.24,-1876.71,12.94))
Re: Help with Multiple points to a /duty -
jakejohnsonusa - 08.12.2012
Yes, THANKS! I will fix and test now