16.12.2012, 02:54
This is a line in my duty system for the FD, For some reason I always get "You are not at the Firemen Lockers!" even when I am on the points that should make me on duty. Whats wrong and how can I fix this?
Here is the code:
PS: When I removed the "!" to test the points, they worked perfectly... But whats wrong now!?!?
Thanks: jakejohnsonusa
Here is the code:
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);
}
}
}
Thanks: jakejohnsonusa