/cop not working, pawno stops complying.
#1

Title says it
pawn Код:
if(strcmp(cmd, "/cop", true) == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GiveNameSpace(sendername);
if(PlayerInfo[playerid][pMember] != 1)
{
SendClientMessage(playerid, COLOR_RED, "You are not a cop!");
return 1;
}
if (!PlayerToPoint(15, playerid,255.3,77.4,1003.6))
{
SendClientMessage(playerid, COLOR_RED, "Your not at the duty point!");
return 1;
}
if(OnDuty[playerid] !=0)
{
if(PlayerInfo[playerid][pRank] == 16) { format(string, sizeof(string), "** Chief Of Police %s is now on duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 15) { format(string, sizeof(string), "** Chief Of Police %s is now on duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 14) { format(string, sizeof(string), "** Chief Of Police %s is now on duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 13) { format(string, sizeof(string), "** Chief Of Police %s is now on duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 12) { format(string, sizeof(string), "** Chief Of Police %s is now on duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 11) { format(string, sizeof(string), "** Chief Of Police %s is now on duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 10) { format(string, sizeof(string), "** Deputy Chief %s is now on duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 9) { format(string, sizeof(string), "** Commander %s is now on duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 8) { format(string, sizeof(string), "** Lieutenant %s is now on duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 7) { format(string, sizeof(string), "** Staff Sargeant %s is now on duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Sargeant %s is now on duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Senior Lead Officer %s is now on duty **", sendername); } }
else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Lead Offier %s is now on duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Police Officer II %s is now on duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Police Officer I %s is now on duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Student %s is now on duty **", sendername); }
else { format(string, sizeof(string), "** Student %s is now off duty **", sendername); }
SendFamilyMessage(PlayerInfo[playerid][pMember], TEAM_BLUE_COLOR, string);
SetPlayerColor(playerid,TEAM_BLUE_COLOR);
OnDuty[playerid] = 1;
return 1;
}
else if(OnDuty[playerid] !=1)
{
if(PlayerInfo[playerid][pRank] == 16) { format(string, sizeof(string), "** Chief Of Police %s is now off duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 15) { format(string, sizeof(string), "** Chief Of Police %s is now off duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 14) { format(string, sizeof(string), "** Chief Of Police %s is now off duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 13) { format(string, sizeof(string), "** Chief Of Police %s is now off duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 12) { format(string, sizeof(string), "** Chief Of Police %s is now off duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 11) { format(string, sizeof(string), "** Chief Of Police %s is now off duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 10) { format(string, sizeof(string), "** Deputy Chief %s is now off duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 9) { format(string, sizeof(string), "** Commander %s is now off duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 8) { format(string, sizeof(string), "** Lieutenant %s is now off duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 7) { format(string, sizeof(string), "** Staff Sargeant %s is now off duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Sargeant %s is now off duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Senior Lead Officer %s is now off duty **", sendername); } }
else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Lead Offier %s is now off duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Police Officer II %s is now off duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Police Officer I %s is now off duty **", sendername); }
else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Student %s is now off duty **", sendername); }
else { format(string, sizeof(string), "** Student %s is now off duty **", sendername); }
ResetPlayerWeaponsEx(playerid);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
SendFamilyMessage(PlayerInfo[playerid][pMember], TEAM_BLUE_COLOR, string);
SetPlayerColor(playerid,TEAM_HIT_COLOR);
OnDuty[playerid] = 0;
}
return 1;
}
Would be nice if you can help!
Reply
#2

Probably a missing bracket.
Reply
#3

When pawno crashes, I believe it means you've missed a bracket somewhere.

try using this:

http://forum.sa-mp.com/showthread.ph...issing+bracket
Reply
#4

I cant seem to get perl to work, ideas?

I mean the missing bracket finder.
Reply
#5

can someone like maybe look at it and see whats wrong? It probably is a bracket, but i cant figure it out.
Reply
#6

pawn Код:
if(strcmp(cmd, "/cop", true) == 0)
{
    GetPlayerName(playerid, sendername, sizeof(sendername));
    GiveNameSpace(sendername);
    if(PlayerInfo[playerid][pMember] != 1)
    {
        SendClientMessage(playerid, COLOR_RED, "You are not a cop!");
        return 1;
    }
    if (!PlayerToPoint(15, playerid,255.3,77.4,1003.6))
    {
        SendClientMessage(playerid, COLOR_RED, "Your not at the duty point!");
        return 1;
    }
    if(OnDuty[playerid] !=0)
    {
        if(PlayerInfo[playerid][pRank] == 16) { format(string, sizeof(string), "** Chief Of Police %s is now on duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 15) { format(string, sizeof(string), "** Chief Of Police %s is now on duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 14) { format(string, sizeof(string), "** Chief Of Police %s is now on duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 13) { format(string, sizeof(string), "** Chief Of Police %s is now on duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 12) { format(string, sizeof(string), "** Chief Of Police %s is now on duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 11) { format(string, sizeof(string), "** Chief Of Police %s is now on duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 10) { format(string, sizeof(string), "** Deputy Chief %s is now on duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 9) { format(string, sizeof(string), "** Commander %s is now on duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 8) { format(string, sizeof(string), "** Lieutenant %s is now on duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 7) { format(string, sizeof(string), "** Staff Sargeant %s is now on duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Sargeant %s is now on duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Senior Lead Officer %s is now on duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Lead Offier %s is now on duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Police Officer II %s is now on duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Police Officer I %s is now on duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Student %s is now on duty **", sendername); }
        else { format(string, sizeof(string), "** Student %s is now off duty **", sendername); }
        SendFamilyMessage(PlayerInfo[playerid][pMember], TEAM_BLUE_COLOR, string);
        SetPlayerColor(playerid,TEAM_BLUE_COLOR);
        OnDuty[playerid] = 1;
        return 1;
    }
    else if(OnDuty[playerid] !=1)
    {
        if(PlayerInfo[playerid][pRank] == 16) { format(string, sizeof(string), "** Chief Of Police %s is now off duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 15) { format(string, sizeof(string), "** Chief Of Police %s is now off duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 14) { format(string, sizeof(string), "** Chief Of Police %s is now off duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 13) { format(string, sizeof(string), "** Chief Of Police %s is now off duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 12) { format(string, sizeof(string), "** Chief Of Police %s is now off duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 11) { format(string, sizeof(string), "** Chief Of Police %s is now off duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 10) { format(string, sizeof(string), "** Deputy Chief %s is now off duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 9) { format(string, sizeof(string), "** Commander %s is now off duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 8) { format(string, sizeof(string), "** Lieutenant %s is now off duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 7) { format(string, sizeof(string), "** Staff Sargeant %s is now off duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Sargeant %s is now off duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Senior Lead Officer %s is now off duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Lead Offier %s is now off duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Police Officer II %s is now off duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Police Officer I %s is now off duty **", sendername); }
        else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Student %s is now off duty **", sendername); }
        else { format(string, sizeof(string), "** Student %s is now off duty **", sendername); }
        ResetPlayerWeaponsEx(playerid);
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 0);
        SendFamilyMessage(PlayerInfo[playerid][pMember], TEAM_BLUE_COLOR, string);
        SetPlayerColor(playerid,TEAM_HIT_COLOR);
        OnDuty[playerid] = 0;
    }
    return 1;
}
// Next time, you don't need a whole program for a little script. Just check every bracket. Only use those programs for huge scripts.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)