SA-MP Forums Archive
Spawning. - 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)
+--- Thread: Spawning. (/showthread.php?tid=432319)



Spawning. - EliteApple - 22.04.2013

I hit the 'new' button to start a new script, I have set up the spawning and everything but for some reason, when I spawn, I spawn with a CJ skin, and I am flew into the air, why does this happen?


Re: Spawning. - DerickClark - 22.04.2013

Try dis:
0 id is cj skin.
you can pick skins from
https://sampwiki.blast.hk/wiki/Skins:All
Код:
public OnGameModeInit()
{
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	return 1;
}



Re: Spawning. - EliteApple - 22.04.2013

I removed all of that. As I wont need that as it'll be a roleplay script, and when you go through the tutorial you'll automatically have a skin adjusted. But since I have no tutorial yet, I already have my player's skin set through the MySQL database.


Re: Spawning. - MatZZPL - 22.04.2013

You need to set the spawning point.. and also the menu where u select the skin before u start the game also is a scrip, if you start fron NEW there will be nothing in the script. If you are learning use one of the scripts in the folder where u downloaded pawno in like grandlarc, they are pretty empty and really easy to edit + that way you learn slowly

@ edit

Okay im confused now, how exactly have you set the spawning point, how can people see if you haven't done anything wrong. Explain a little bit moreee


Re: Spawning. - EliteApple - 22.04.2013

I already have functions for the player to spawn. I have my player's SKIN already assigned through my MySQL database.
pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerInterior(playerid,0);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerPos(playerid,1742.8767,-1863.5521,13.5749);
    if(gPlayerLogged[playerid])
    {
        SetPlayerSpawn(playerid);
        SetPlayerHealth(playerid,100);
    }
    return 1;
}
pawn Код:
forward SetPlayerSpawn(playerid);
public SetPlayerSpawn(playerid)
{
   
        if(PlayerInfo[playerid][pSpawnPoint] == 0)
        {
            Wounded[playerid] = 0;
            SetPlayerPos(playerid,1742.8767,-1863.5521,13.5749);
            SetPlayerVirtualWorld(playerid, 0);
            SetPlayerInterior(playerid, 0);
            SetPlayerFacingAngle(playerid,0);
            SetPlayerHealth(playerid,100);
            gPlayerLogged[playerid] = 1;
        }
        if(PlayerInfo[playerid][pAdmin] > 0)
        {
            new string2[64];
            format(string2, sizeof(string2), "SERVER: You are logged in as a level %d admin",PlayerInfo[playerid][pAdmin]);
            SendClientMessage(playerid, COLOR_WHITE, string2);
        }
    }
        return 1;
    }



Re: Spawning. - EliteApple - 22.04.2013

See, now this is happening, I managed to get it to set my character's cordinates to Unity, but the spawn options below are still there.
http://i36.tinypic.com/aem9vk.png