Faction Ranks (read)
#1

Read my last post. (2nd page)
Reply
#2

Try moving the " facrank = PlayerInfo[playerid][pRank] " somewhere outside the stock?
If I can remember well, That's how it should be, If it's not that, Sorry.. Just came back to samp after a year and trying to help.
Reply
#3

pawn Код:
new faction = PlayerInfo[playerid][pMember], facrank = PlayerInfo[playerid][pRank];
There.
Reply
#4

..Never mind my reply
Reply
#5

Semicolon, semicolon, semicolon!

Also, it makes no sense to use a switch statement, and then not again.

http://puu.sh/6lid9/2a57eb261e.png - These can be put in a switch.
Reply
#6

Код:
C:\Users\***\Desktop\NB\Madson Gaming (OFFICIAL SERVER)\gamemodes\KG.pwn(57917) : error 017: undefined symbol "facrank"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
pawn Код:
CMD:invite(playerid, params[])
{
    if (PlayerInfo[playerid][pLeader] >= 1)
    {
        new string[128], ftext[50], giveplayerid;
        if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /invite [playerid]");

        if(IsPlayerConnected(giveplayerid))
        {
            if (PlayerInfo[giveplayerid][pLeader] == 0 && PlayerInfo[giveplayerid][pMember] == 0 && PlayerInfo[giveplayerid][pFMember] == 255)
            {
                if(PlayerInfo[playerid][pLeader] == 1) { ftext = "LSPD"; }
                else if(PlayerInfo[playerid][pLeader] == 2) { ftext = "FBI"; }
                else if(PlayerInfo[playerid][pLeader] == 3) { ftext = "DHS"; }
                else if(Team_LSFMD(playerid)) { ftext = "LSFMD"; }
                else if(PlayerInfo[playerid][pLeader] == 5) { ftext = "Judicial System"; }
                else if(PlayerInfo[playerid][pLeader] == 6) { ftext = "The Government"; }
                else if(PlayerInfo[playerid][pLeader] == 7) { ftext = "SAST"; }
                else if(PlayerInfo[playerid][pLeader] == 8) { ftext = "Hitman Agency"; }
                else if(PlayerInfo[playerid][pLeader] == 9) { ftext = "SANews"; }
                else if(PlayerInfo[playerid][pLeader] == 10) { ftext = "Taxi Cab Company"; }
                else if(PlayerInfo[playerid][pLeader] == 11) { ftext = "National Guard"; }
                else if(PlayerInfo[playerid][pLeader] == 12) { ftext = "Tierra Robada"; }
                else if(PlayerInfo[playerid][pLeader] == 13) { ftext = "NOOSE"; }
                else if(PlayerInfo[playerid][pLeader] == 13) { ftext = "Mafia Brotherhood"; }
                else { return 1; }
                InviteOffer[giveplayerid] = playerid;
                InviteFamily[giveplayerid] = 255;
                InviteFaction[giveplayerid] = PlayerInfo[playerid][pLeader];
                format(string, sizeof(string), "%s %s has offered you an invite to %s - type /accept faction.", facrank, GetPlayerNameEx(playerid), ftext);
                SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
                format(string, sizeof(string), "You have offered %s an invite to %s.", GetPlayerNameEx(giveplayerid),ftext);
                SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
            }
            else
            {
                SendClientMessageEx(playerid, COLOR_GREY, "The player you're trying to invite is already in another faction or family.");
                return 1;
            }

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

booop
Reply
#8

Bump 2x.
Reply
#9

if you create a new variable inside a stock it's only exists in that stock
https://sampwiki.blast.hk/wiki/Scripting_Basics#Scope

instead of using facrank in your command why not just use PlayerInfo[playerid][pRank] because that's what it is
Reply
#10

if I were you, i'd:

1) Not use the godfather script, or an edit of godfather, it's outdated.

2) Change the rank to a string, and make the command setrank [nameofrank], it's less of a pain in the ass in game that way
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)