23.04.2012, 15:18
Debugging can help you finding the cause of the problem.
Note: if it doesn't print #2 but it does print #7, it means that the player is not on admin duty.
Please post where it ends
pawn Code:
CMD:adminduty(playerid,params[])
{
print("#1");
new name[MAX_PLAYER_NAME], ip[24];
if(PlayerInfo[playerid][Admin] >1 || IsPlayerAdmin(playerid))
{
print("#2");
if(AdminDuty[playerid] == 1) return SendClientMessage(playerid, WHITE, ""COL_YELLOW"[INFO]"COL_WHITE"You already have Admin Duty on!");
print("#3");
AdminDuty[playerid] = 1;
SetPlayerHealth(playerid, 5000);
SetPlayerArmour(playerid, 100);
SetPlayerColor(playerid, CRVENA);
GivePlayerWeapon(playerid, 9, 20000);
GivePlayerWeapon(playerid, 18, 20000);
GivePlayerWeapon(playerid, 24, 20000);
GivePlayerWeapon(playerid, 26, 20000);
GivePlayerWeapon(playerid, 28, 20000);
GivePlayerWeapon(playerid, 29, 20000);
GivePlayerWeapon(playerid, 30, 20000);
GivePlayerWeapon(playerid, 31, 20000);
GivePlayerWeapon(playerid, 38, 20000);
GivePlayerWeapon(playerid, 36, 20000);
print("#4");
SendClientMessage(playerid, WHITE, ""COL_YELLOW"[INFO]"COL_WHITE"You turn on Admin Duty.");
SendClientMessageToAll(WHITE, ""COL_YELLOW"[INFO]"COL_RED"Admin : "COL_WHITE"%s "COL_RED"| Duty: "COL_WHITE"On");
GetPlayerIp(playerid, ip, 24);
print("#5");
format(CmdString, 80, "| Admin | Player: %s | Duty: On| IP: %s", ime, ip);
WriteLog(FILE_DUTYLOG, CmdString);
print("#6");
}
else {
print("#7: server is returning false(value: 0) for: AdminDuty[playerid] == 1");
SendClientMessage(playerid, WHITE, ""COL_YELLOW"[INFO]"COL_WHITE"Sorry,you don't have persmission to use this command!");
}
return 1;
}
Please post where it ends

