SA-MP Forums Archive
SetSpawnInfo - 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: SetSpawnInfo (/showthread.php?tid=593242)



SetSpawnInfo - rambalili2 - 03.11.2015

So I have this command for spawning after death but I want the spawn the player after death in that location
but he will be able to choose a different skin. how can i do that?




PHP код:
CMD:spawn(playeridparams[])
{
SetSpawnInfo(playeridpBikers51254.5229,-1367.1545,53.1094,297.067000000);
return 
1;




Re: SetSpawnInfo - itsCody - 03.11.2015

Make a new variable or something like
PHP код:
new bool:JustDied[MAX_PLAYERS]; 
when the player dies set it to true

PHP код:
JustDied[playerid] = true
and do something like?

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    if(
killerid != INVALID_PLAYER_ID)
    {
        
JustDied[playerid] = true;
    }
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    if(
JustDied[playerid] == true)
    {
        
/*
            Just remove SetPlayerSkin and insert your code for them to select a skin.
        */
        
SetPlayerPos(playerid254.5229, -1367.154553.1094);
        
SetPlayerFacingAngle(playerid297.0670);
        
SetPlayerSkin(playerid51); // Biker Skin?
        
SetPlayerTeam(playeridpBikers);
        
JustDied[playerid] = false;
    }
    return 
1;




Re: SetSpawnInfo - rambalili2 - 03.11.2015

I want it as a command tho


Re: SetSpawnInfo - itsCody - 03.11.2015

Then do the same thing as OnPlayerSpawn but inside a command

PHP код:
CMD:spawn(playeridparams[])
{
    if(
JustDied[playerid] == true)
    {
        
/*
            Just remove SetPlayerSkin and insert your code for them to select a skin.
        */
        
SetPlayerPos(playerid254.5229, -1367.154553.1094);
        
SetPlayerFacingAngle(playerid297.0670);
        
SetPlayerSkin(playerid51); // Biker Skin?
        
SetPlayerTeam(playeridpBikers);
        
JustDied[playerid] = false;
    }
    else 
SendClientMessage(playerid, -1"Unable to process command");
    return 
1;




Re: SetSpawnInfo - rambalili2 - 03.11.2015

Not working it do it instant.


Re: SetSpawnInfo - itsCody - 03.11.2015

Honestly I don't even get your issue as your English seems a little off, but can you try and explain what you want done a little bit better?


Re: SetSpawnInfo - rambalili2 - 03.11.2015

Alright
i have this command that when i do /spawn it will spawn me after i die in the location i set it to.
but it will spawn me with the skin i set it to.

I want it to spawn at this location but it will show up the skin menu and it will spawn me with the skin i chose
from the menu to that location.


Re: SetSpawnInfo - itsCody - 03.11.2015

Then use something like mSelection to show the player several skins to select from when they respawn? Or create your own system.


Re: SetSpawnInfo - rambalili2 - 03.11.2015

yeah but i want it before they spawn to choose a skin not when they spawn


Re: SetSpawnInfo - Vince - 03.11.2015

https://sampwiki.blast.hk/wiki/ForceClassSelection