SetSpawnInfo
#1

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;

Reply
#2

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;

Reply
#3

I want it as a command tho
Reply
#4

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;

Reply
#5

Not working it do it instant.
Reply
#6

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?
Reply
#7

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.
Reply
#8

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

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

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


Forum Jump:


Users browsing this thread: 2 Guest(s)