IS this possible? - 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: IS this possible? (
/showthread.php?tid=154426)
IS this possible? -
mailliw17 - 13.06.2010
is it possible that they can just choose which team from the skins? instead of typing /zombie /human?
CODE
Код:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1134.3170, -2036.5797, 69.0078);
SetPlayerInterior(playerid, 0);
SetPlayerFacingAngle(playerid, 38.4801);
SetPlayerCameraPos(playerid, 1130.8170, -2032.5797, 70.5078);
SetPlayerCameraLookAt(playerid, 1134.3170, -2036.5797, 69.0078);
if(classid == 0 || classid == 1) {
GameTextForPlayer(playerid,"~g~HUMAN ~w~TEAM",1000,5);
} else if(classid == 2 || classid == 3) {
GameTextForPlayer(playerid,"~b~ZOMBIE~w~TEAM",1000,5);
}
return 1;
}
Re: IS this possible? -
DJDhan - 13.06.2010
Place this at the top of your script.
Код:
#define TEAM_HUMAN 0
#define TEAM_ZOMBIE 1
new gTeam[MAX_PLAYERS];
Then, your code...
Код:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1134.3170, -2036.5797, 69.0078);
SetPlayerInterior(playerid, 0);
SetPlayerFacingAngle(playerid, 38.4801);
SetPlayerCameraPos(playerid, 1130.8170, -2032.5797, 70.5078);
SetPlayerCameraLookAt(playerid, 1134.3170, -2036.5797, 69.0078);
if(classid == 0 || classid == 1)
{
GameTextForPlayer(playerid,"~g~HUMAN ~w~TEAM",1000,5);
}
else if(classid == 2 || classid == 3)
{
GameTextForPlayer(playerid,"~b~ZOMBIE~w~TEAM",1000,5);
}
SetPlayerTeamFromClass(playerid, classid);
return 1;
}
After That,
Код:
stock SetPlayerTeamFromClass(playerid,classid)
{
if(classid == 0 || classid == 1)
{ gTeam[playerid]= TEAM_HUMAN;
}
else if(classid == 2 || classid == 3)
{
gTeam[playerid]=TEAM_ZOMBIE;
}
}
Done.
Re: IS this possible? -
mailliw17 - 14.06.2010
it shows this error
Код:
C:\Documents and Settings\William\Desktop\samp03asvr_R7_win32\gamemodes\zombies.pwn(376) : warning 217: loose indentation
C:\Documents and Settings\William\Desktop\samp03asvr_R7_win32\gamemodes\zombies.pwn(377) : warning 217: loose indentation
C:\Documents and Settings\William\Desktop\samp03asvr_R7_win32\gamemodes\zombies.pwn(383) : error 001: expected token: "]", but found ";"
C:\Documents and Settings\William\Desktop\samp03asvr_R7_win32\gamemodes\zombies.pwn(387) : error 001: expected token: "]", but found ";"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
Re: IS this possible? - TheInnocentOne - 14.06.2010
pawn Код:
stock SetPlayerTeamFromClass(playerid,classid)
{
if(classid == 0 || classid == 1)
{ gTeam[playerid] = TEAM_HUMAN;
}
else if(classid == 2 || classid == 3)
{
gTeam[playerid] = TEAM_ZOMBIE;
}
}
The two warnings are because some code is out of line with lines around it
Re: IS this possible? -
DJDhan - 14.06.2010
And the two errors are because I forgot a bracket around playerid :P Fixed
Re: IS this possible? -
mailliw17 - 14.06.2010
other error
Код:
C:\Documents and Settings\William\Desktop\samp03asvr_R7_win32\gamemodes\zombies.pwn(375) : warning 217: loose indentation
C:\Documents and Settings\William\Desktop\samp03asvr_R7_win32\gamemodes\zombies.pwn(376) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Warnings.
Re: IS this possible? -
mailliw17 - 14.06.2010
bump
Re: IS this possible? -
Dolph - 14.06.2010
That errors means that you have to tab some more.
Re: IS this possible? -
mailliw17 - 14.06.2010
what do you mean?
Re: IS this possible? -
mailliw17 - 14.06.2010
bump