Spawn
#5

Код:
public OnPlayerSpawn(playerid)
{
	if(IsPlayerNPC(playerid))
    {
        new npcname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, npcname, sizeof(npcname));
        if(!strcmp(npcname, "Tram_Driver", true))//Trams_Driver = 956 Tram_Driver = 360
        {
            PutPlayerInVehicle(playerid, 360, 0);
        }
        if(!strcmp(npcname, "Trams_Driver", true))
        {
            PutPlayerInVehicle(playerid, 956, 0);
        }
        return 1;
    }
	if (PLAYERLIST_authed[playerid])
	{
//	    new nome[ 256 ];
//		format(nome, sizeof(nome),"14[SPAWNED] [%s - %d] %s[%d] has spawned.",AdminLevelName(playerid),PlayerInfo[playerid][power], PlayerName(playerid),playerid);
//		iEcho( nome );
	    StopAudioStreamForPlayer(playerid);
	    Killing_Spree_Count[playerid] = 0;
		//SetTimerEx("StopSpectate", 100, false, "d", playerid);
	    //SetTimerEx("JustSpawned", 180000, false, "dd", playerid,0);
		if(!gPlayerAnimLibsPreloaded[playerid])
		{
			PreloadAnimLib(playerid,"BOMBER");
			PreloadAnimLib(playerid,"RAPPING");
			PreloadAnimLib(playerid,"SHOP");
			PreloadAnimLib(playerid,"BEACH");
			PreloadAnimLib(playerid,"SMOKING");
			PreloadAnimLib(playerid,"FOOD");
			PreloadAnimLib(playerid,"ON_LOOKERS");
			PreloadAnimLib(playerid,"DEALER");
			PreloadAnimLib(playerid,"CRACK");
			PreloadAnimLib(playerid,"CARRY");
			PreloadAnimLib(playerid,"COP_AMBIENT");
			PreloadAnimLib(playerid,"PARK");
			PreloadAnimLib(playerid,"INT_HOUSE");
			PreloadAnimLib(playerid,"FOOD");
			PreloadAnimLib(playerid,"PED");
			gPlayerAnimLibsPreloaded[playerid] = 1;
		}
	    StopPlayerHoldingObjectEx(playerid);
	    SetPVarInt(playerid, "Tazer", 0);
	    SetPVarInt(playerid, "BriefCaseTill", 0);
	    if(GetPVarInt(playerid, "SkinSelect") == 1)
		{
	        SetTimerEx("SetPlayerBack", 350, false, "dd", playerid,1);
	        new tmpid=IsPlayerInBiz(playerid);
			if(tmpid!=-1)
			{
				new filename[50],tmpbank;
				format(filename,sizeof(filename),"%s.txt",biz[tmpid][bizname]);
				tmpbank=dini_Int(filename,"bizcash");
				dini_IntSet(filename,"bizcash",tmpbank+1000);
				GivePlayerMoneyEx(playerid,-1000);
				PlayerTemp[playerid][spawnrdy]=0;
			}
	        return 1;
		}
		TextDrawHideForPlayer(playerid, plrwarning[playerid]);
		TextDrawHideForPlayer(playerid, jailtd[playerid]);
		TextDrawHideForPlayer(playerid, InjuredTD);
		PlayerTemp[playerid][HasRedScreen] = 0;
	    SetPVarInt(playerid, "GarageID", -1);
	    SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, 1);
	    SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1);
	    TextDrawHideForPlayer(playerid, PlayerTemp[playerid][InfoBox]);
	    TextDrawHideForPlayer(playerid, LocationTD[playerid]);
	    TextDrawHideForPlayer(playerid, Harvest[playerid]);
	    TextDrawHideForPlayer(playerid, Cargo[playerid]);
	    if(PlayerTemp[playerid][deaded]==2){
	    PlayerTemp[playerid][deaded]=0;
      	return 1;
 		}
	    if(PlayerTemp[playerid][adminduty])
	    {
	        SendClientMessage(playerid, COLOR_LIGHTGREY, " Info: You are still on adminduty! You cannot roleplay!");
	        SetTimerEx("AdminDutyFunction", 1200, false, "d", playerid);
	    }
   	    if(PlayerTemp[playerid][helperduty])
	    {
	        SendClientMessage(playerid, COLOR_LIGHTGREY, " Info: You are still on helperduty! You cannot roleplay!");
	        SetTimerEx("AdminDutyFunction", 1200, false, "d", playerid);
	    }
	    SetPlayerArmour(playerid, 0.0);
	    TextDrawShowForPlayer(playerid, PlayerTemp[playerid][Status]);
	    TextDrawShowForPlayer(playerid, LocationTD[playerid]);
    	TextDrawShowForPlayer(playerid, TextDraw__News);
    	TextDrawShowForPlayer(playerid, IMtxt);
    	TextDrawHideForPlayer(playerid, TellTD);
   		TextDrawHideForPlayer(playerid, TextDraw__Top1);
		TextDrawHideForPlayer(playerid, TextDraw__Bottom1);
		new Float:px,Float:py,Float:pz;
		if(MoneyCheckEx(playerid)) return 1;
		GetPlayerPos(playerid,px,py,pz);
		PlayerPlaySound(playerid,SOUND_GOGO_TRACK_STOP,px,py,pz);
		SetPlayerHealth(playerid,100);
		for(new q; q < sizeof(Gangzones); q++)
		{
			GangZoneShowForPlayer(playerid, Gangzones[q][gID], GetFactionTurfColour(Gangzones[q][gFACTION]));
			TextDrawHideForPlayer(playerid, Gangzones[q][gDRAW]);
			if(Gangzones[q][gBLINK] == 1) GangZoneFlashForPlayer(playerid, Gangzones[q][gID], COLOR_WHITE);
		}

 		if(PlayerInfo[playerid][jailtime]>1 || PlayerInfo[playerid][jail])
	 	{
	 	    PlayerTemp[playerid][imprisoned] = 1;
		    Jail(playerid,PlayerInfo[playerid][jailtime],PlayerInfo[playerid][bail],PlayerInfo[playerid][jailreason]);
   			new id = random(sizeof(PrisonCells));
			SetPlayerPos(playerid, PrisonCells[id][0], PrisonCells[id][1], PrisonCells[id][2]);
			SetTimerEx("Freeze123", 1000, 0, "i", playerid);
			TogglePlayerControllable(playerid, false);
			SetPlayerInterior(playerid,3);
		    return 1;
		}
		else
		{
		    if(IsPlayerInPaintball(playerid))
		    {
				SetPlayerPaintBall(playerid, PlayerTemp[playerid][onpaint], PlayerTemp[playerid][pbteam]);
				return 1;
			}
			SetTimerEx("CheckCrash", 750, false, "d", playerid);
			if(PlayerInfo[playerid][housenum]==-1) DefaultSpawn(playerid);
			else HouseSpawn(playerid, PlayerInfo[playerid][housenum]);
		}
	}
	else
	{
		switch(random(2))
		{
			case 0:
			{
				SetPlayerCameraPos(playerid,967.4384,2559.5483,10.7003);
				SetPlayerCameraLookAt(playerid,982.4874,2561.6409,22.5239);
				SetPlayerPos(playerid,967.4384,2559.5483,5.7003);
            }
		}
		SetPlayerInterior(playerid,0);
		SetPlayerColor(playerid, COLOR_RED);
		TogglePlayerControllable(playerid,false);
		return 1;
	}
	return 1;
}
Try this code em sure it will work

OnPlayerspawn should not return 0;

it should return 1.

Hope it will help you Budy.
Reply


Messages In This Thread
Spawn - by justjamie - 19.05.2016, 18:11
Re: Spawn - by BloodyRP - 19.05.2016, 18:53
Re: Spawn - by justjamie - 20.05.2016, 10:52
Re: Spawn - by luke49 - 20.05.2016, 11:19
Re: Spawn - by MBilal - 20.05.2016, 11:24
Re: Spawn - by justjamie - 20.05.2016, 11:52
Re: Spawn - by denNorske - 20.05.2016, 12:20

Forum Jump:


Users browsing this thread: 1 Guest(s)