Leader name
#1

Hey.. I'm trying to make that if you enter to a place so the name of the leader of the faction i'll decide will be mentioned...
this is part from my /enter command:

pawn Code:
else if (PlayerToPoint(2.0, playerid,2421.4934,-1219.2512,25.5613)) //
            {
                SetPlayerInterior(playerid,2);
                SetPlayerPos(playerid,1204.809936,-11.586799,1000.921875);
                new leader = PlayerInfo[playerid][pLeader] = 1;
                new tmp2[256];
                format(tmp2, sizeof(tmp2), "~w~This place owned by:~g~ %s", leader);
                GameTextForPlayer(playerid, tmp2, 5000, 1);
            }
and ofc.. its not working cuz i'm doing something wrong..
Reply
#2

pawn Code:
else if (PlayerToPoint(2.0, playerid,2421.4934,-1219.2512,25.5613)) //
            {
                SetPlayerInterior(playerid,2);
                SetPlayerPos(playerid,1204.809936,-11.586799,1000.921875);
                new leader = PlayerInfo[playerid][pLeader] = 1;
                new tmp2[256];
                format(tmp2, sizeof(tmp2), "~w~This place owned by:~g~ %d", leader);
                GameTextForPlayer(playerid, tmp2, 5000, 1);
            }
Try it now.
Reply
#3

Quote:
Originally Posted by -Luis
View Post
pawn Code:
else if (PlayerToPoint(2.0, playerid,2421.4934,-1219.2512,25.5613)) //
            {
                SetPlayerInterior(playerid,2);
                SetPlayerPos(playerid,1204.809936,-11.586799,1000.921875);
                new leader = PlayerInfo[playerid][pLeader] = 1;
                new tmp2[256];
                format(tmp2, sizeof(tmp2), "~w~This place owned by:~g~ %d", leader);
                GameTextForPlayer(playerid, tmp2, 5000, 1);
            }
Try it now.
Doesn't the script has to get the name of the leader in the format ?
Reply
#4

Wait, could you explain what your errors are properly.
Reply
#5

pawn Code:
else if (PlayerToPoint(2.0, playerid,2421.4934,-1219.2512,25.5613)) //
            {
                new leadername[36];
                for(new i=0;i<MAX_PLAYERS;i++)
                {
                    if(PlayerInfo[i][pLeader] == 1)
                    {
                        GetPlayerName(i, leadername, sizeof(leadername));
                    }
                    SetPlayerInterior(playerid,2);
                    SetPlayerPos(playerid,1204.809936,-11.586799,1000.921875);
                    new tmp2[256];
                    format(tmp2, sizeof(tmp2), "~w~This place owned by:~g~ %s", leadername);
                    GameTextForPlayer(playerid, tmp2, 5000, 1);
                }
            }
I think he wants, that when a player enters a certain area, the player will be shown a message with the name of the area's owner. But he isn't getting the name of the leader. Surely this:

pawn Code:
PlayerInfo[playerid][pLeader] = 1
wouldn't mean the name of the leader ?
Reply
#6

Well yea.. I want that if ANY PLAYER enter to area he gets the owner of the place.. which is faction leader..
btw.. i tried:

pawn Code:
else if (PlayerToPoint(2.0, playerid,2421.4934,-1219.2512,25.5613)) //
            {
                new leadername[36];
                for(new i=0;i<MAX_PLAYERS;i++)
                {
                    if(PlayerInfo[i][pLeader] == 1)
                    {
                        GetPlayerName(i, leadername, sizeof(leadername));
                    }
                    SetPlayerInterior(playerid,2);
                    SetPlayerPos(playerid,1204.809936,-11.586799,1000.921875);
                    new tmp2[256];
                    format(tmp2, sizeof(tmp2), "~w~This place owned by:~g~ %d", leadername);
                    GameTextForPlayer(playerid, tmp2, 5000, 1);
                }
            }
and still not working... when I enter its saying owner: 74
and i get no errors at all
Reply
#7

My god, are we all that dumb?

Okay, you want it to show the NAME of the FACTION LEADER,
so you need to use a database to store the faction information. Use a .ini file system or mysql for this. You can't do what you want until you do this.
Reply
#8

Quote:
Originally Posted by Qur
View Post
Well yea.. I want that if ANY PLAYER enter to area he gets the owner of the place.. which is faction leader..
btw.. i tried:

pawn Code:
else if (PlayerToPoint(2.0, playerid,2421.4934,-1219.2512,25.5613)) //
            {
                new leadername[36];
                for(new i=0;i<MAX_PLAYERS;i++)
                {
                    if(PlayerInfo[i][pLeader] == 1)
                    {
                        GetPlayerName(i, leadername, sizeof(leadername));
                    }
                    SetPlayerInterior(playerid,2);
                    SetPlayerPos(playerid,1204.809936,-11.586799,1000.921875);
                    new tmp2[256];
                    format(tmp2, sizeof(tmp2), "~w~This place owned by:~g~ %d", leadername);
                    GameTextForPlayer(playerid, tmp2, 5000, 1);
                }
            }
and still not working... when I enter its saying owner: 74
and i get no errors at all
format(tmp2, sizeof(tmp2), "~w~This place owned by:~g~ %d", leadername);

d - integer, s - string. In this case your'e using a player's name, so you have to use %s.



Quote:

My god, are we all that dumb?

Okay, you want it to show the NAME of the FACTION LEADER,
so you need to use a database to store the faction information. Use a .ini file system or mysql for this. You can't do what you want until you do this.

Your'e wrong.
Reply
#9

Thanks a lot.. I changed to d cuz someone here said.. i didnt know all this..
right now working
thank you all
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)