26.06.2015, 09:08
Quote:
@Infinity, @Sellize, you mean Like this?:
pawn Code:
|
PHP Code:
public OnPlayerSpawn(playerid)
{
SetPlayerVirtualWorld(playerid, playerid); // Set his VW to his own playerid
Spawntimer[playerid] = SetTimerEx("Spawnprotect", 5000, false, "d", playerid);
SendClientMessage(playerid, -1, "You are under spawn protection for 5 seconds.");
GameTextForPlayer(playerid, "~g~Spawn Protection On", 3000, 4); // this will send a green game text (because of the ~g~) to the player and it will only last 3000 miliseconds (3 seconds), with the game text type 4
return 1;
}
Why would you check if world == 0? You could just do this to prevent the world from being 0:
PHP Code:
public OnPlayerSpawn(playerid)
{
SetPlayerVirtualWorld(playerid, random(39)+1); // Add 1 to the random number to prevent it from being 0
Spawntimer[playerid] = SetTimerEx("Spawnprotect", 5000, false, "d", playerid);
SendClientMessage(playerid, -1, "You are under spawn protection for 5 seconds.");
GameTextForPlayer(playerid, "~g~Spawn Protection On", 3000, 4); // this will send a green game text (because of the ~g~) to the player and it will only last 3000 miliseconds (3 seconds), with the game text type 4
return 1;
}