Help with this, Its bugged, no reason?
#1

Hello, me again.. xd... i have this code under OnPlayerSpawn

Код:
if (GetPlayerSkin(playerid) == 287)
		{
		    rand = random(sizeof(RandomGERMSpawn));
	    	Teams[playerid] = TEAM_GERMANS;
		    SetPlayerColor(playerid,COLOR_TEAM_GERMANS);
		    SetPlayerScore(playerid,Kills[playerid]);
   			if(MAP == MAP_DOCKS)
			{
			    SetPlayerPos(playerid,RandomGERMSpawn[rand][0],RandomGERMSpawn[rand][1],RandomGERMSpawn[rand][2]);
			    SetPlayerFacingAngle(playerid,RandomGERMSpawn[rand][3]);
       			SetPlayerMapIcon(playerid,0,2464.8328,-2635.8115,13.6628,56,0);
       			SetVehicleParamsForPlayer(GERMANMAV,playerid,0,0);
	   			SetVehicleParamsForPlayer(USAMAV,playerid,0,1);
	   			//SetPlayerWorldBounds(playerid, 2919.731, 1212.258, -2163.486, -2771.438);
			}
			else 
			{
			    SetPlayerPos(playerid,RandomGERMSpawn2[rand][0],RandomGERMSpawn2[rand][1],RandomGERMSpawn2[rand][2]);
			    SetPlayerFacingAngle(playerid,RandomGERMSpawn2[rand][3]);
			    SetVehicleParamsForPlayer(GERMANMAV,playerid,0,0);
	   			SetVehicleParamsForPlayer(USAMAV,playerid,0,1);
				SetPlayerMapIcon(playerid,2,646.2488,-2092.0308,11.8620,56,0);
			}
			
		}
		else if(GetPlayerSkin(playerid) == 285)
		{
		    rand = random(sizeof(RandomUSASpawn));
			Teams[playerid] = TEAM_USA;
		    SetPlayerColor(playerid,COLOR_TEAM_USA);
		    SetPlayerScore(playerid,Kills[playerid]);
   			if(MAP == MAP_DOCKS)
   			{
   				SetPlayerPos(playerid,RandomUSASpawn[rand][0],RandomUSASpawn[rand][1],RandomUSASpawn[rand][2]);
			    SetPlayerFacingAngle(playerid,RandomUSASpawn[rand][3]);
       			SetPlayerMapIcon(playerid,1,2491.1599,-2369.0054,13.6250,56,0);
	   			SetVehicleParamsForPlayer(GERMANMAV,playerid,0,1);
   				SetVehicleParamsForPlayer(USAMAV,playerid,0,0);
   				//SetPlayerWorldBounds(playerid, 2919.731, 1212.258, -2163.486, -2771.438);
			}
			else
			{
			    SetPlayerPos(playerid,RandomUSASpawn2[rand][0],RandomUSASpawn2[rand][1],RandomUSASpawn2[rand][2]);
			    SetPlayerFacingAngle(playerid,RandomUSASpawn2[rand][3]);
			    SetVehicleParamsForPlayer(GERMANMAV,playerid,0,1);
   				SetVehicleParamsForPlayer(USAMAV,playerid,0,0);
   				SetPlayerMapIcon(playerid,3,499.8717,-1875.2053,4.6770,56,0);
			}
		}
	}
For some reason... Whenever the map changes, the spawns bug... and dont spawn the player correctly... i dont see reason for this...S o im asking... any ideas?...
Reply
#2

There is an extra brace in the code. I fixed the indentation and put it on pastebin for you. I'm not sure why this is happening. Are player skins resetting when the map changes? What do you mean by "spawns bug"? They don't spawn? They spawn in the wrong place? Tell me more about the problem.
Reply
#3

Thanks... The Indentinatio and the extra braquets might be cuz i just copy that part from the code so... the skins are ok... but player spawns at the coords i have on "AddPlayerClass"... for some reason it aint setting the players to the random locations...
Reply
#4

Sorry for Double Post but... i even lost track of the page the post was... and i really need help with this... Plz...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)