IS this possible?
#1

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;
}
Reply
#2

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.
Reply
#3

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.
Reply
#4

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
Reply
#5

And the two errors are because I forgot a bracket around playerid :P Fixed
Reply
#6

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

bump
Reply
#8

That errors means that you have to tab some more.
Reply
#9

what do you mean?
Reply
#10

bump
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)