Classid 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)
+--- Thread: Classid help (
/showthread.php?tid=375740)
Classid help -
trapstar2020 - 08.09.2012
i want 2 add more classid to the gteam like
yuh know like ids 0-10 instead of having it as one can anyone tell how 2 to such?
SetPlayerTeamFromClass(playerid, classid)
{
if(classid == 0)
{
gTeam[playerid] = GROVE_STREET;
}
if(classid == 1)
{
gTeam[playerid] = POLICE;
}
}
Re: Classid help -
vIBIENNYx - 08.09.2012
pawn Код:
new classid[MAX_PLAYERS] = 0;
Then on request spawn you need to add some way to pick them, the class id can be up to any number, you would use it like this:
pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
if(classid[playerid] == 0)
{
gTeam[playerid] = GROVE_STREET;
}
if(classid[playerid] == 1)
{
gTeam[playerid] = POLICE;
}
if(classid[playerid] == 2)
{
gTeam[playerid] = TEAM 3;
}
if(classid[playerid] == 3)
{
gTeam[playerid] = TEAM 4;
}
// Etc.
}
In your function "SetPlayerTeamFromClass" You'd need to edit the same accordingly.