some questions / help.
#1

hello all,
im creating TDM server, and i got some questions...
1) well, im using TM cars, and players system (gTeam).. and how can i do that: when ~10players join to Yakuza, another players cant join yakuza? t.y max players in one team - 10.
2) hmm, i really idk, how can i do that: player can join SWAT team, if he doesnt got score than <2000
3) FIXED
Thanks.
Reply
#2

update, help.
Reply
#3

1) and 2) is just playing with some variables. Search.
Reply
#4

Quote:

You can bump topics when the last reply is at least 12 hours old, and it needs to have useful information about your problem

+ click

All your answers are at 'click'
Reply
#5

1. Try something like this:
pawn Код:
//global var
new gTeamCount[ MAX_TEAMS ]; //change MAX_TEAMS with the number of teams you got
pawn Код:
//when a player joins a team
if( gTeamCount[ ID_OF_TEAM ] == 10 ) //change ID_OF_TEAM with the actual ID of the team
{
    SendClientMessage( playerid, 0xFF0000FF, "There are already max players in this team, chose another one!" );
    //do whatever you want
}
gTeamCount[ ID_OF_TEAM ]++;
2. Use GetPlayerScore:

pawn Код:
//when a player tries to join SWAT team
if( GetPlayerScore( playerid ) < 2000 )
    return SendClientMessage( playerid, 0xFF0000FF, "This team requires 2000 score!" );
These are just examples, play around with it
Reply
#6

1)
Код:
//when a player joins a team
if( gTeamCount[ ID_OF_TEAM ] == 10 ) //change ID_OF_TEAM with the actual ID of the team
{
    SendClientMessage( playerid, 0xFF0000FF, "There are already max players in this team, chose another one!" );
    return 0;
}
else
{
    return gTeamCount[ ID_OF_TEAM ]++;
}
You forgot on return 0;
Reply
#7

Quote:
pawn Код:
//do whatever you want
I wrote that for a reason..
Maybe he wanted to go back some steps or w/e, so I cba to put return false there.
Reply
#8

Ok, my mistake.
Reply
#9

No problem. ^^
Reply
#10

well, im tryied some like this:
if (GetPlayerTeam(playerid) == Nostra)
{
if( GetPlayerScore( playerid ) < 2000 )
SendClientMessage(playerid, MELYNA2,"* TESTZ");
return 0;}
( on RequestSpawn )
no errors, etc but im with 0score can join...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)