SA-MP Forums Archive
I can't get the spawn right. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I can't get the spawn right. (/showthread.php?tid=278744)



I can't get the spawn right. - davelord - 23.08.2011

I can't manage to get them spawning at MY location.

Posses from below:

Quote:

SetPlayerPos(playerid,2242.4685,2446.0229,10.8203) ;
SetPlayerPos(playerid,2242.4685,2446.0229,10.8203) ;

I want them both to spawn here: AddPlayerClass(280,2286.8809,2431.5552,10.8203,359 .0491,0,0,0,0,0,0);

Code:
	if(pInfo[playerid][pFBI] >= 1)
	{
	    SetPlayerPos(playerid,2242.4685,2446.0229,10.8203);
	    SetPlayerFacingAngle(playerid,359.7383);
	    SetPlayerSkin(playerid,286);
	    if(OnDuty[playerid] == 1)
	    {
	    	SetPlayerStuff(playerid,24,307,29,330,3,1,100,100);
		}
		else
		{
			SetPlayerStuff(playerid,24,307,0,0,3,1,100,0);
		}
	}
	if(pInfo[playerid][pCop] >= 1)
	{
	    SetPlayerPos(playerid,2242.4685,2446.0229,10.8203);
	    SetPlayerFacingAngle(playerid,359.7383);
	    if(OnDuty[playerid] == 1)
	    {
	    	SetPlayerStuff(playerid,24,307,29,330,3,1,100,100);
		}
		else
		{
			SetPlayerStuff(playerid,24,307,0,0,3,1,100,0);
		}
	}



Re: I can't get the spawn right. - dud - 23.08.2011

use public

onplayerspawn
and
setplayerspawn


Re: I can't get the spawn right. - davelord - 23.08.2011

I'm not /that/ good, could you give me a example? D:


Re: I can't get the spawn right. - dud - 23.08.2011

Code:
public OnPlayerSpawn(playerid)
{
	SetPlayerSpawn(playerid);
        SetSpawnInfo(playerid, -1, 0,0.0,0.0,0.0,0,0,0,0,0,0,0);
	return 1;
}
Code:
public SetPlayerSpawn(playerid)
{
	    put here what you want to spawn...
}
but i dont know what you trying to spawn and how you want to do that...


Re: I can't get the spawn right. - davelord - 23.08.2011

Nononono, if you look to the 'script' you'll understand. I quote:

"if(pInfo[playerid][pFBI] >= 1)
{
SetPlayerPos(playerid,2242.4685,2446.0229,10.8203) ;" <- If the playerinfo if pFBI or pCop, I don't want them to spawn there, but here;: AddPlayerClass(280,2286.8809,2431.5552,10.8203,359 .0491,0,0,0,0,0,0);


Re: I can't get the spawn right. - davelord - 23.08.2011

Please...


Re: I can't get the spawn right. - sleepysnowflake - 23.08.2011

pawn Code:
if(pInfo[playerid][pFBI] >= 1)
    {
        SetPlayerPos(playerid,2286.8809,2431.5552,10.8203);
        SetPlayerFacingAngle(playerid,359 .0491);
        SetPlayerSkin(playerid,286);
        if(OnDuty[playerid] == 1)
        {
            SetPlayerStuff(playerid,24,307,29,330,3,1,100,100);
        }
        else
        {
            SetPlayerStuff(playerid,24,307,0,0,3,1,100,0);
        }
    }
    if(pInfo[playerid][pCop] >= 1)
    {
        SetPlayerPos(playerid,2286.8809,2431.5552,10.8203);
        SetPlayerFacingAngle(playerid,359 .0491);
        if(OnDuty[playerid] == 1)
        {
            SetPlayerStuff(playerid,24,307,29,330,3,1,100,100);
        }
        else
        {
            SetPlayerStuff(playerid,24,307,0,0,3,1,100,0);
        }
    }
Helps ?


Re: I can't get the spawn right. - davelord - 23.08.2011

No :/


Re: I can't get the spawn right. - sleepysnowflake - 23.08.2011

Where do you have this pFBI and pCop lines ?