Trouble switching from 0.3c to 0.3d
#1

Hello guys, for some reason when i try to spawn in my own coded gamemode ( it aint edit of some kind ) when i try spawn I get " Server Closed Connection " and I don't even have a single " Kick(playerid) " under OnPlayerSpawn, and please note that in 0.3c it was working perfectly, and now i don't know what is the reason, and also yes, i can connect to other 0.3d servers here is my OnPlayerSpawn code.

Код:
public OnPlayerSpawn(playerid)
{
	if(IsPlayerNPC(playerid))
	{
		print("NPC Bus1 OnPlayerSpawned Success");
    	new npcname[MAX_PLAYER_NAME];
    	GetPlayerName(playerid, npcname, sizeof(npcname));
    	if(!strcmp(npcname, "Bus1", true)) //Checking if the NPC's name is Bus1
    	{
    	    print("Putting NPC Bus1 in the vehicle");
			PutPlayerInVehicle(playerid, bus1, 0); //Putting the NPC into the vehicle we created for it.
			Attach3DTextLabelToVehicle(bus1text, bus1, 0.0, 0.0, 2.0);
			return 1;
		}
		if(!strcmp(npcname, "Bus2", true))
		{
  			print("Putting NPC Bus2 in the vehicle");
			PutPlayerInVehicle(playerid, bus2, 0); //Putting the NPC into the vehicle we created for it.
			Attach3DTextLabelToVehicle(bus2text, bus2, 0.0, 0.0, 2.0);
			return 1;
		}
		if(!strcmp(npcname, "License", true))
		{
		    print("Placing NPC PDLicense in location");
	    	SetPlayerInterior(playerid,10);
		    SetPlayerPos(playerid,253.7954,117.3986,1003.2188);
		    SetPlayerFacingAngle(playerid,88.0003);
		    SetPlayerSkin(playerid,280);
		    return 1;
		}
		// Other NPCS
		return 1;
	}
	SetPlayerColor(playerid,COLOR_WHITE);
	if((PlayerInfo[playerid][vowned] != 0) && (VSinfo[PlayerInfo[playerid][vowned]][vowner] != PlayerInfo[playerid][name]))
	{
		PlayerInfo[playerid][vowned] = 0;
		SavePlayer(playerid);
	}
	SetPlayerSkin(playerid,PlayerInfo[playerid][skin]);
	if(PlayerInfo[playerid][jail] == 1)
	{
	    SetPlayerColor(playerid,COLOR_BRIGHTRED);
		SetPlayerPos(playerid,1540.5173,-1780.0386,13.5469);
		SetPlayerInterior(playerid,0);
		PlayerInfo[playerid][jailtimer] = SetTimerEx("AdminJail",30*1000*60,0,"%i",playerid);
		SendClientMessage(playerid,COLOR_BRIGHTRED,"You were Auto-jailed for jail Evade and you gained 30mins jail, Enjoy!");
		PlayerInfo[playerid][jail] = 1;
		TogglePlayerControllable(playerid,0);
		return 0;
	}

	if(PlayerInfo[playerid][spawn] == 0)            // Default Spawn ( near bikes )
	{
		SetPlayerPos(playerid,1210.2546,-2037.0696,69.0078);
		SetPlayerFacingAngle(playerid,269.3941);
		return 1;
	}
	else if(PlayerInfo[playerid][spawn] == 1)       // If Player is in Gang / Faction
	{
		if(PlayerInfo[playerid][ispolitic] != 0)
		{
		    SetPlayerPos(playerid,370.2852,181.6077,1008.3828);
		    SetPlayerInterior(playerid,3);
		    return 1;
		}
		if(PlayerInfo[playerid][policerank] != 0)
		{
		    SetPlayerPos(playerid,1525.6190,-1678.0696,5.8906);
		    SetPlayerInterior(playerid,0);
		    return 1;
		}
	}
	else if(PlayerInfo[playerid][spawn] == 2)       // If Player spawn in his / her house
	{
 		if(PlayerInfo[playerid][housekey] != 0)
   		{
			SetPlayerPos(playerid,Hinfo[PlayerInfo[playerid][housekey]][intX],Hinfo[PlayerInfo[playerid][housekey]][intY],Hinfo[PlayerInfo[playerid][housekey]][intZ]);
			SetPlayerInterior(playerid,Hinfo[PlayerInfo[playerid][housekey]][interiorid]);
			SetPlayerVirtualWorld(playerid,Hinfo[PlayerInfo[playerid][housekey]][virtualworld]);
			PlayerInfo[playerid][phid] = PlayerInfo[playerid][housekey];
			GameTextForPlayer(playerid,"Welcome Home",3000,1);
			return 1;
		}
		if(PlayerInfo[playerid][rentroomkey] != 0)
		{
			SetPlayerPos(playerid,Hinfo[PlayerInfo[playerid][rentroomkey]][intX],Hinfo[PlayerInfo[playerid][rentroomkey]][intY],Hinfo[PlayerInfo[playerid][rentroomkey]][intZ]);
			SetPlayerInterior(playerid,Hinfo[PlayerInfo[playerid][rentroomkey]][interiorid]);
			SetPlayerVirtualWorld(playerid,Hinfo[PlayerInfo[playerid][rentroomkey]][virtualworld]);
			PlayerInfo[playerid][phid] = PlayerInfo[playerid][rentroomkey];
			GameTextForPlayer(playerid,"Welcome Home",3000,1);
			return 1;
		}
		return 1;
	}

	SetCameraBehindPlayer(playerid);
	SetPlayerHealth(playerid,50);
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		SetPlayerMarkerForPlayer(i,playerid,0xFFFFFF00);
	}
	return 1;
}
Please also note, that the game does not crash or some kind, only getting disconnected after trying spawn.



EDIT: Also when i checked in the logs the server only say " Player LEFT " not kicked.
And also Please note that i'm using " SpawnPlayer " function to spawn.
Reply
#2

Anwser: https://sampforum.blast.hk/showthread.php?tid=303454
Reply
#3

thanks alot. guys
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)