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



OnPlayerSpawn - karoliko - 24.05.2016

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?


Re: OnPlayerSpawn - Stinged - 24.05.2016

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.


Re: OnPlayerSpawn - oMa37 - 24.05.2016

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

It's simple.


Re: OnPlayerSpawn - karoliko - 24.05.2016

Thanks


Re: OnPlayerSpawn - Slawiii - 24.05.2016

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;