28.04.2016, 18:24
Guys i made DM zone. Everything is nice but there is one problem. When player dies in DM zone i want him to respawn in DM zone but he respawns on start spawn. How to fix this??
CMD:dm(playerid, params[])
{
PlayerJoinedDMZone[playerid] = 1;
new randomcoords = random(sizeof(DMSpawn));
SPP(playerid, DMSpawn[randomcoords][0],
DMSpawn[randomcoords][1],
DMSpawn[randomcoords][2]);
GivePlayerWeapon(playerid, 26, 100);
GivePlayerWeapon(playerid, 22, 100);
GivePlayerWeapon(playerid, 25, 100);
GivePlayerWeapon(playerid, 28, 500);
GivePlayerWeapon(playerid, 30, 100);
GivePlayerWeapon(playerid, 33, 50);
SetPlayerArmour(playerid, 100);
SPH(playerid, 100);
return 1;
}
CMD:napustidm(playerid, params[])
{
PlayerJoinedDMZone[playerid] = 0;
SCM(playerid, 0xF81414, "Napustili ste DM zonu");
SPP(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
if(PlayerJoinedDMZone[playerid] == 1)
{
new randomcoords = random(sizeof(DMSpawn));
SPP(playerid, DMSpawn[randomcoords][0], DMSpawn[randomcoords][1], DMSpawn[randomcoords][2]);
}
|
Remove this from under OnPlayerDeath and put this under OnPlayer Spawn
if(PlayerJoinedDMZone[playerid] == 1) { new randomcoords = random(sizeof(DMSpawn)); SPP(playerid, DMSpawn[randomcoords][0], DMSpawn[randomcoords][1], DMSpawn[randomcoords][2]); } |