OnPlayerSpawn
#1

Hello, i was in some server the other day and everytime when i died, when i spawned i cannot saw nobody till some some time (like 5 seconds) Itґs that possible to make?
Reply
#2

Change the player's virtual world to something unique.
Example:
Код:
#define UNIQUE_VWORLD            4999

public OnPlayerSpawn(playerid)
{
    SetPlayerVirtualWorld(playerid, UNIQUE_VWORLD + playerid);
    return 1;
}
And then set a timer, and make it call SetPlayerVirtualWorld(playerid, 0); to reset the world.
Reply
#3

Spawn player
Change his world
Make a timer
Back the default world.

It's simple.
Reply
#4

Thanks
Reply
#5

you can use a timer example
PHP код:
public OnPlayerSpawn(playerid)
{
    
SetPlayerVirtualWorld(playerid10000);
    
SetTimerEx("DefaultWorld"5000false"i"playerid);// 5000 => 5000 MS ( 5 second )
}

forward DefaultWorld(playerid);
public 
DefaultWorld(playerid);
{
    
SetPlayerVirtualWorld(playerid0);
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)