Players wont show at spawn
#1

whoopsy from the last topic

anyway Am I doing something wrong here? I am making a zombie gamemode and when i set the team class's and all, the skins dont show when you choose a class, then when you spawn your not even in the same team color. I defined all the teams needed, i #defined the army class, zombie class, and civilian class's. I all set the up with the TEAM_(class)_COLOR and such. Here is the set team color code i currently have:

Код:
public SetPlayerToTeamColor(playerid)
{
	if (gTeam[playerid] == TEAM_ZOMBIE)
	{
		SetPlayerColor(playerid, TEAM_ZOMBIE_COLOR);
	}
	else if (gTeam[playerid] == TEAM_CIVILIAN)
	{
		SetPlayerColor(playerid, TEAM_CIVILIAN_COLOR);
	}
	else if (gTeam[playerid] == TEAM_ARMY)
	  SetPlayerColor(playerid, TEAM_ARMY_COLOR);
}
BUT when I compile my GM, it shows these warnings:

Код:
C:\Documents and Settings\XXX\My Documents\sampserver\gamemodes\zombie.pwn(85) : warning 235: public function lacks forward declaration (symbol "SetPlayerToTeamColor")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
And when i spawn, everything works expect when i hit TAB and look at my name, my player color is orange.

So what could be the problem here? Team colors wont show and players wont show when choosing class. Heres what my whole public OnGameModeInit(); looks like:

Код:
public OnGameModeInit()
{
	// Don't use these lines if it's a filterscript
	SetGameModeText("XXX");
  AddPlayerClassEx(1,287,175.6730,1924.5999,18.1226,91.2024,30,500,0,0,0,0); // Army
  AddPlayerClassEx(2,188,-16.5302,1115.4778,20.9399,98.5333,66,500,0,0,0,0); // civilian
  AddPlayerClassEx(3,200,-2.3147,1385.5845,9.1719,128.4714,18,150,26,650,0,0); // zombie
  	AddStaticVehicle(418,158.7585,1907.4329,18.8309,2.7012,108,108); // van1
	AddStaticVehicle(418,161.7791,1907.5505,18.7472,1.4209,81,81); // van2
	AddStaticVehicle(421,184.2991,1935.5192,17.7081,176.2737,25,1); // washington
	AddStaticVehicle(421,180.8786,1935.8268,17.8410,176.9678,36,1); // washington2
	AddStaticVehicle(433,227.9811,1890.3204,18.0791,178.7353,43,0); // convoy
	AddStaticVehicle(433,200.2627,1887.3387,18.0847,176.5367,43,0); // convoy2
	AddStaticVehicle(431,134.4581,1925.9886,19.2739,89.5329,55,83); // bus
	AddStaticVehicle(543,-88.3689,1340.0682,10.4729,6.5632,67,8); // truck1
	AddStaticVehicle(543,-91.9422,1338.8202,10.3637,4.0945,8,90); // truck2
	AddStaticVehicle(542,-102.9873,1349.3553,9.7397,311.1196,113,92); // clover1
	AddStaticVehicle(542,-96.7165,1343.7059,10.0958,320.7224,113,92); // clover1
	AddStaticVehicle(505,-29.1680,1386.3992,9.3156,130.5197,112,120); // rancher1
	AddStaticVehicle(505,-16.0261,1361.3748,9.3150,133.3813,112,120); // rancher2
	AddStaticVehicle(516,-25.8087,1114.8475,19.6340,356.8635,57,46); // crown1
	AddStaticVehicle(516,1.5435,1085.5031,19.6299,80.1813,57,46); // crown2
	AddStaticVehicle(516,-31.8218,1072.5474,19.6319,359.9234,57,46); // crown3
	AddStaticVehicle(518,-45.3527,1044.7053,19.4310,359.3235,37,0); // buc1
	AddStaticVehicle(518,-29.7412,1061.3204,19.4129,91.1233,37,0); // buc2
	AddStaticVehicle(518,-2.8941,1048.8206,19.4092,1.5213,37,0); // buc3
Can someone give me a hand here since i iz a noob at scripting.
Reply
#2

You've made a public function to set the team color, place this above the public:

pawn Код:
forward SetPlayerToColor(playerid);
Also, please paste your OnPlayerRequestClass().
Reply
#3

eh, well i have done nothing to that yet. So its un-edited.

Код:
public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}
Edit: Also i added the
Код:
forward SetPlayerToTeamColor(playerid);
above the public line. It got rid of the error but still my player color is still orange.
Reply
#4

pawn Код:
if(classid == 0)
{
gTeam[playerid] = TEAM_ZOMBIE;
}
else if(classid == 1)
{
gTeam[playerid] = TEAM_CIVILIAN;
}
I can't remember the full usage or if this is the correct callback, try add it, might work.
Reply
#5

Nope, that did not work, it gave me 5 errors instead.

Код:
C:\Documents and Settings\XXX\My Documents\sampserver\gamemodes\zombie.pwn(88) : error 017: undefined symbol "classid"
C:\Documents and Settings\XXX\My Documents\sampserver\gamemodes\zombie.pwn(92) : warning 217: loose indentation
C:\Documents and Settings\XXX\My Documents\sampserver\gamemodes\zombie.pwn(92) : error 017: undefined symbol "classid"
C:\Documents and Settings\XXX\My Documents\sampserver\gamemodes\zombie.pwn(97) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Reply
#6

Add it to OnPlayerRequestClass(playerid, classid)
Reply
#7

guessing problem solved??!
Reply
#8

Sorry mates, problem not solved. Here, the whole GM. I really need help here, Heres a pastebin link to the GM, i dont really care for it now as its not even %5 done yet. But please do tell me what i did wrong so i can carry on with it.

http://pastebin.com/m6f2df497
Reply
#9

Quote:
Originally Posted by string227
Sorry mates, problem not solved. Here, the whole GM. I really need help here, Heres a pastebin link to the GM, i dont really care for it now as its not even %5 done yet. But please do tell me what i did wrong so i can carry on with it.

http://pastebin.com/m6f2df497
Sorry to hear, I'm really tired at the moment so I doubt I'll be able to help any further, try checking the wiki and good luck.
Reply
#10

calgon u lazy?? ROFL
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)