public OnPlayerSpawn(playerid)
{ if(pInfo[playerid][pbstatus]==true){
pbrespawn(playerid);
}
return 1;
}
public pbrespawn(playerid)
{
new rand;
rand=random(4);
switch(rand)
{
case 0: SetPlayerPos(playerid,-1679.0305,1376.4728,12.3906);
case 1: SetPlayerPos(playerid,-1641.2963,1401.5313,7.1875);
case 2: SetPlayerPos(playerid,-1648.1776,1369.9368,7.1797);
case 3: SetPlayerPos(playerid,-1692.3961,1353.3668,9.8047);
}
GivePlayerWeapon(playerid,pbarena[PB_ACTIVE][wep1],999);
GivePlayerWeapon(playerid,pbarena[PB_ACTIVE][wep2],999);
SetPlayerHealth(playerid,pbarena[PB_ACTIVE][pbhp]);
SetPlayerArmour(playerid,pbarena[PB_ACTIVE][pbarmor]);
SetPlayerVirtualWorld(playerid,1);
return 1;
}
pInfo[playerid][pbstatus]==true
// top of your script
enum e_spawns
{
Float:x,
Float:y,
Float:z
}
new Float:pbspawns[][e_spawns] = {
{-1679.0305,1376.4728,12.3906},
{-1641.2963,1401.5313,7.1875},
{-1648.1776,1369.9368,7.1797},
{-1692.3961,1353.3668,9.8047}
};
// replacing your existing code
SetPlayerPos(playerid, pbspawns[playerid][x], pbspawns[playerid][y], pbspawns[playerid][z]);
|
Код:
pInfo[playerid][pbstatus]==true also here's a better solution for your spawning. Код:
// top of your script
enum e_spawns
{
Float:x,
Float:y,
Float:z
}
new Float:pbspawns[][e_spawns] = {
{-1679.0305,1376.4728,12.3906},
{-1641.2963,1401.5313,7.1875},
{-1648.1776,1369.9368,7.1797},
{-1692.3961,1353.3668,9.8047}
};
// replacing your existing code
SetPlayerPos(playerid, pbspawns[playerid][x], pbspawns[playerid][y], pbspawns[playerid][z]);
|
pInfo[playerid][pbstatus]==true