PTP Vice President function!
#1

Heey players

I make a ptp server. I want to make that if the president dies that the vicepresident changes to the president!
I cant figure it out:S

Pls help

thank Admigo
Reply
#2

E.G

if(gTeam[playerid] == TEAM_PRESIDENT)
{
gTeam[playerid] = TEAM_NONE;
gTeam[GetViceID()] = TEAM_PRESIDENT;

}
Reply
#3

How can i get vice id? I use PTPM Gamemode script
Reply
#4

Make a stock so it runs though a loop and check if the team of that player is vice president, if it is stop the loop and return the playerid.
Reply
#5

Can you give code because i am beginner. I dont know anything about loops:S
Reply
#6

Quote:
Originally Posted by admigo
Посмотреть сообщение
Can you give code because i am beginner. I dont know anything about loops:S
This isn't the request section.

pawn Код:
stock GetViceID()
{
     new ID = -1;
     for(new i; i < MAX_PLAYERS; i++) //Foreach (Y)
     {
          if(IsPlayerConnected(i) && IsVice[i]) ID = i; break;
     }
     if(ID != -1) return ID;
     else printf("No vice id found.");
}
Reply
#7

And how to get the vice id with skin 147. I use gTeam
Reply
#8

Quote:
Originally Posted by admigo
Посмотреть сообщение
And how to get the vice id with skin 147. I use gTeam
Change "IsVice[i]" to whatever variable the Vice is stored in.

perhaps
pawn Код:
gTeam[i] == TEAM_VICE
Reply
#9

And how can i make the vice function?
Reply
#10

Quote:
Originally Posted by admigo
Посмотреть сообщение
And how can i make the vice function?
You're pretty good to explain
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)