SA-MP Forums Archive
Team Help For A TDM - 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: Team Help For A TDM (/showthread.php?tid=161964)



Team Help For A TDM - Garc1a - 21.07.2010

I need help with classes and such so I need someone to guide me through it.

So heres my problem..

I have this:
pawn Код:
AddPlayerClass(105, 2495.1658, -1687.5807, 13.5154, 0.6267, 24, 250, 5, 0, 0, 0);
    AddPlayerClass(103, 2067.6406, -1731.3610, 13.8762, 271.9942, 24, 250, 5, 0, 0, 0);
I've scripted it so that the first one is Grove..
and the second Ballas..

if I add another under it is Ballas, another under that would be Ballas etc.

But how can I make it so that the first 3 are Grove, then the 3 under that are Ballas.

Please help


Re: Team Help For A TDM - MisterTickle - 21.07.2010

Well what you could do is OnPlayerSpawn you could check what their skin is... Like

Код:
new skin = GetPlayerSkin(playerid);
if(skin == 105) return team[playerid] = 1; (Implying the 1 variable means Grove)
else if(skin == 103) return team[playerid] = 2; (Implying the 2 variable means Ballas)



Re: Team Help For A TDM - Garc1a - 21.07.2010

Quote:
Originally Posted by MisterTickle
Посмотреть сообщение
Well what you could do is OnPlayerSpawn you could check what their skin is... Like

Код:
new skin = GetPlayerSkin(playerid);
if(skin == 105) return team[playerid] = 1; (Implying the 1 variable means Grove)
else if(skin == 103) return team[playerid] = 2; (Implying the 2 variable means Ballas)
Thank-you, I will try this.


Re: Team Help For A TDM - Garc1a - 21.07.2010

Now I have

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerToTeamColor(playerid);
    new skin = GetPlayerSkin(playerid);
    if(skin == 105) return team[playerid] = 0;
    else if(skin == 106) return team[playerid] = 0;
    else if(skin == 107) return team[playerid] = 0;
    else if(skin == 102) return team[playerid] = 1;
    else if(skin == 103) return team[playerid] = 1;
    else if(skin == 104) return team[playerid] = 1;
    return 1;
}
and have errors:

pawn Код:
C:\Users\Johnny\Desktop\Urban TDM - Copy\gamemodes\UTDM.pwn(145) : error 017: undefined symbol "team"
C:\Users\Johnny\Desktop\Urban TDM - Copy\gamemodes\UTDM.pwn(145) : warning 215: expression has no effect
C:\Users\Johnny\Desktop\Urban TDM - Copy\gamemodes\UTDM.pwn(145) : error 001: expected token: ";", but found "]"
C:\Users\Johnny\Desktop\Urban TDM - Copy\gamemodes\UTDM.pwn(145) : error 029: invalid expression, assumed zero
C:\Users\Johnny\Desktop\Urban TDM - Copy\gamemodes\UTDM.pwn(145) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Line '145' is:
pawn Код:
if(skin == 105) return team[playerid] = 0;
*PS - Sorry for double post*


Re: Team Help For A TDM - MisterTickle - 21.07.2010

What is your variable to know what you're team is?

team[playerid] was an example. You need to make a variable like

new Team[MAX_PLAYERS];

Than you use for commands and such and loops to check if you're in a team like if(team[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You are not in the Ballas!");


Re: Team Help For A TDM - Garc1a - 21.07.2010

Thanks!

Turns out it was 'gTeam'

Thank you so much for making that clear.




Re: Team Help For A TDM - MisterTickle - 21.07.2010

No problem.