[Help please] LSPD Divisions don't work
#1

Right, i used this for all factions but none of the factions divsions are working now somehow, when you type ig like /LSPDdiv it just says "unknown command". Any help would be great, thanks!

CMD:LSPDdiv(playerid, params[])
{
if(IsACop(playerid))
{
new string[128], giveplayerid, division;
if(sscanf(params, "ud", giveplayerid, division))
{
SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /LSPDdiv [playerid] [division]");
SendClientMessageEx(playerid, COLOR_GRAD2, "Available division names: 1 (None), 2 (II), 3 (FTO), 4 (IA), 5 (TSG)");
return 1;
}

if (PlayerInfo[playerid][pRank] >= 4)
{
if(IsPlayerConnected(giveplayerid))
{
if(PlayerInfo[playerid][pMember] == 1)
{
if(division == 3)
{
PlayerInfo[giveplayerid][pDivision] = 3;
format(string, sizeof(string), "You are now in the FTO division, invited by %s.", GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "You have invited %s into the FTO division.", GetPlayerNameEx(giveplayerid));
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
}
else if(division == 2)
{
PlayerInfo[giveplayerid][pDivision] = 2;
format(string, sizeof(string), "You are now in the II division, invited by %s.", GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "You have invited %s to join the II division.", GetPlayerNameEx(giveplayerid));
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
}
else if(division == 4)
{
PlayerInfo[giveplayerid][pDivision] = 4;
format(string, sizeof(string), "You are now in the IA division, invited by %s.", GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "You have invited %s to join the IA division.", GetPlayerNameEx(giveplayerid));
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
}
else if(division == 5)
{
PlayerInfo[giveplayerid][pDivision] = 5;
format(string, sizeof(string), "You are now in the TSG division, invited by %s.", GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "You have invited %s to join the TSG division.", GetPlayerNameEx(giveplayerid));
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
}
else if(division == 1)
{
PlayerInfo[giveplayerid][pDivision] = 1;
format(string, sizeof(string), "You have been kicked from your division by %s.", GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "You have kicked %s out of their division.", GetPlayerNameEx(giveplayerid));
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
}
}

}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command - only R4+ can do this.");
}
}
return 1;
Reply
#2

Try this, not tested.

pawn Код:
CMD:LSPDdiv(playerid, params[])
{
    if(IsACop(playerid))
    {
        new string[128], giveplayerid, division;
        if(sscanf(params, "ud", giveplayerid, division))
        {
            SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /LSPDdiv [playerid] [division]");
            return SendClientMessageEx(playerid, COLOR_GRAD2, "Available division names: 1 (None), 2 (II), 3 (FTO), 4 (IA), 5 (TSG)");
        }

        if (PlayerInfo[playerid][pRank] >= 4)
        {
            if(IsPlayerConnected(giveplayerid))
            {
                if(PlayerInfo[playerid][pMember] == 1)
                {
                    if(division == 3)
                    {
                        PlayerInfo[giveplayerid][pDivision] = 3;
                        format(string, sizeof(string), "You are now in the FTO division, invited by %s.", GetPlayerNameEx(playerid));
                        SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "You have invited %s into the FTO division.", GetPlayerNameEx(giveplayerid));
                        SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
                    }
                    else if(division == 2)
                    {
                        PlayerInfo[giveplayerid][pDivision] = 2;
                        format(string, sizeof(string), "You are now in the II division, invited by %s.", GetPlayerNameEx(playerid));
                        SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "You have invited %s to join the II division.", GetPlayerNameEx(giveplayerid));
                        SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
                    }
                    else if(division == 4)
                    {
                        PlayerInfo[giveplayerid][pDivision] = 4;
                        format(string, sizeof(string), "You are now in the IA division, invited by %s.", GetPlayerNameEx(playerid));
                        SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "You have invited %s to join the IA division.", GetPlayerNameEx(giveplayerid));
                        SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
                    }
                    else if(division == 5)
                    {
                        PlayerInfo[giveplayerid][pDivision] = 5;
                        format(string, sizeof(string), "You are now in the TSG division, invited by %s.", GetPlayerNameEx(playerid));
                        SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "You have invited %s to join the TSG division.", GetPlayerNameEx(giveplayerid));
                        SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
                    }
                    else if(division == 1)
                    {
                        PlayerInfo[giveplayerid][pDivision] = 1;
                        format(string, sizeof(string), "You have been kicked from your division by %s.", GetPlayerNameEx(playerid));
                        SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "You have kicked %s out of their division.", GetPlayerNameEx(giveplayerid));
                        SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
        }
        else
        {
            SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command - only R4+ can do this.");
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)