SA-MP Forums Archive
some questions / help. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: some questions / help. (/showthread.php?tid=174130)



some questions / help. - AndriusZ* - 04.09.2010

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.


Re: some questions / help. - AndriusZ* - 04.09.2010

update, help.


Re: some questions / help. - Ironboy500[TW] - 04.09.2010

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


Re: some questions / help. - Dime - 04.09.2010

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'


Re: some questions / help. - LarzI - 04.09.2010

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


Re: some questions / help. - Ironboy500[TW] - 04.09.2010

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;


Re: some questions / help. - LarzI - 04.09.2010

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.


Re: some questions / help. - Ironboy500[TW] - 04.09.2010

Ok, my mistake.


Re: some questions / help. - LarzI - 04.09.2010

No problem. ^^


Re: some questions / help. - AndriusZ* - 04.09.2010

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...