Help Me Spawning In Death Stadium Interior
#1

Hi friends please help me how can i make a system like if is player in death stadium interior if he die in that interior then he will spawn from there not from gamemode spawn points and if player is not in death stadium then his spawn points should be random of defined in gamemode spawn points so please help me how can i make that system
Reply
#2

Quote:
Originally Posted by MaxJohnson
Посмотреть сообщение
Hi friends please help me how can i make a system like if is player in death stadium interior if he die in that interior then he will spawn from there not from gamemode spawn points and if player is not in death stadium then his spawn points should be random of defined in gamemode spawn points so please help me how can i make that system
https://sampwiki.blast.hk/wiki/OnPlayerDeath
https://sampwiki.blast.hk/wiki/GetPlayerInterior
https://sampwiki.blast.hk/wiki/GetPlayerVirtualWorld
(https://sampwiki.blast.hk/wiki/GetPlayerPos)
https://sampwiki.blast.hk/wiki/Scripting_Basics#Variables

(ps the variable is meant for you to make variable if player died)

https://sampwiki.blast.hk/wiki/OnPlayerSpawn
https://sampwiki.blast.hk/wiki/SetPlayerPos
https://sampwiki.blast.hk/wiki/SetPlayerInterior
https://sampwiki.blast.hk/wiki/SetPlayerVirtualWorld
Reply
#3

Set player's interior first then change world if needed, Change his/her location or make an array if you want it to be a random one.

The above user have posted some links that I was gonna paste so get help from them.
Reply
#4

pawn Код:
new bool:stadium[MAX_PLAYERS]; //a bool that will keep track of if a player is in the stadium or not.

public OnPlayerConnect(playerid)
{
    stadium[playerid] =false; //Resetting the variable for players connecting.
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(stadium[playerid] == true) //If the player is going, this will set their position upon respawn.
    {
        SetPlayerInterior(playerid,0);
        SetPlayerVirtualWorld(playerid,0);
        SetPlayerPos(playerid,0.0,0.0,0.0);
        SetPlayerFacingAngle(playerid,0.0);
    }
    return 1;
}

YCMD:deathstadium(playerid,params[],help)
{
    if(stadium[playerid] == true)
    {
        stadium[playerid] =false; //If False, it will respawn the player and OnPlayerSpawn will spawn the player normally.
        SpawnPlayer(playerid);
    }
    else
    {
        stadium[playerid] =true; //If True, it will respawn the player and OnPlayerSpawn will spawn the player to the coordinates specified in OnPlayerSpawn.
        SpawnPlayer(playerid);
    }
    return 1;
}
Something like this I suppose.
Reply
#5

they isnt working please give a clear code
Reply
#6

Quote:
Originally Posted by MaxJohnson
Посмотреть сообщение
they isnt working please give a clear code
Код:
YCMD:deathstadium(playerid,params[],help)
change this to your command processor.

put the OnPlayerSpawn code at the bottom of your onplayerspawn callback.
Reply
#7

You'll need the Stadium Interior ID & Coordinate.

Then,

Код:
public OnPlayerDeath(playerid) {
   if(IsPlayerInRangeOfPoint(playerid,500.0,STADIUM_X,STADIUM_Y,STADIUM_Z) && GetPlayerInterior(playerid) == STADIUM_INT) {
       SetPlayerPos(playerid,STADIUM_X,STADIUM_Y,STADIUM_Z);
       SetPlayerInterior(playerid,STADIUM_INT);
    }
    return true;
}
Replace STADIUM_* with right coordinates/ids.
Reply
#8

What cmd processor you use? And give us the co-ordinates you want the player to spawn when he is not in death stadium .
Give us the death stadium codes , and cmd .

Then we can give you codes a per your convinient.
Reply
#9

Quote:
Originally Posted by fuckingcruse
Посмотреть сообщение
What cmd processor you use? And give us the co-ordinates you want the player to spawn when he is not in death stadium .
Give us the death stadium codes , and cmd .

Then we can give you codes a per your convinient.
Not sure he asked for a command
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)