>>> Checking if players are in<<<
#1

Im having trouble with somehting. When i make gangzones and checkpoints I know like the if scenario.But i am trying to figure out say I have a Green Team and a Red Team. Well say there is a weapon list. I say if blablabla
{
blahahah
}
how do i do the else to say like if your not on tht team it prevents you from using it
Reply
#2

pawn Код:
//Example using an array to store team

if(team[playerid] == GREEN_TEAM)
{
// Do stuff if the players team is GREEN
}
else
{
// Do stuff if the players team is not GREEN
}
Reply
#3

Quote:
Originally Posted by Joe_
pawn Код:
//Example using an array to store team

if(team[playerid] == GREEN_TEAM)
{
// Do stuff if the players team is GREEN
}
else
{
// Do stuff if the players team is not GREEN
}
Ok thanks soo saui crreate menu.

if (team[playerid] == GREEN_TEAM)
{
//Say we create menu and they use it and access it
}
else
//try to acces menu
//You are not this team!


Also thanks alot man man! You are awesome

Reply
#4

pawn Код:
if(Team[playerid] == TEAM_GREEN)
{
    ShowMenuForPlayer(...); // Not sure if that's the right function, you understand though.
    return 1;
}
SendClientMessage(playerid, YOUR_COLOUR, "You cannot use this menu.");

/*
That will check if the players team is TEAM_GREEN
If it is, it will show a menu.
then return 1, so it will never reach the message.
If the player is not TEAM_GREEN it will skip to the message.
*/
Reply
#5

thanks alot man!
Reply
#6

We are in 2010, we have SA:MP v0.3a, why the hell are people still using array to store team? That was modern in previous versions when GetPlayerTeam native wasn't working.
Reply
#7

Quote:
Originally Posted by $ЂЯĢ
We are in 2010, we have SA:MP v0.3a, why the hell are people still using array to store team? That was modern in previous versions when GetPlayerTeam native wasn't working.
Because maybe they want teams WITHOUT godmode?
Reply
#8

What return should it have?

EDIT:
if (gTeam[playerid] == NoTOReUZ)

error 017: undefined symbol "playerid"

I've done this the whole time in my script all of a sudden this appears
Reply
#9

Quote:
Originally Posted by ToPhrESH
What return should it have?
What do you mean?
Reply
#10

Quote:
Originally Posted by » Lorenc « (back)
Quote:
Originally Posted by ToPhrESH
What return should it have?
What do you mean?
isPlayerInArea needed to have a return! Dont worry though i got the return. im so sorry for this guys but ive stayed up all night on my script and am too tired to even think haha. Thanks also guys! YOU GUYS ARE AWESOME and smart
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)