Problem with PlayerSpawn. -
I'm trying to make an PaintBall arena in my gamemode but there something wrong when player got killed he is spawning at hospital but if you die by yourself you will spawn good in the defined spawns for the paintball.
MalaArenaS[playerid] - its not used.
PlayerInfo[playerid][pArena] - its for SendArenaMessage..
PlayerInfo[playerid][Dead] - its for spawns.
pawn Код:
if(PlayerInfo[playerid][Dead] == 1)
{
MalaArenaS[playerid] = 1;
PBArena[playerid] = 1;
PlayerInfo[playerid][pArena] = 1;
PlayerInfo[playerid][Dead] = 1;
ResetDodWeapons(playerid);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 7652);
SetPlayerTeam(playerid, MALASPEC);
SetPlayerColor(playerid, COLOR_YELLOW);
SetPlayerSkin(playerid, 285);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
GiveDodWeapon(playerid, 26, cellmax);
GiveDodWeapon(playerid, 28, cellmax);
GiveDodWeapon(playerid, 24, cellmax);
GiveDodWeapon(playerid, 34, cellmax);
new rand = random(sizeof(gSpawnMA));
SetPlayerFacingAngle(playerid, gSpawnMA[rand][2]);
SetPlayerPos(playerid, gSpawnMA[rand][0], gSpawnMA[rand][1], gSpawnMA[rand][2]); // Mala Arena Specijalac
}
if(PlayerInfo[playerid][Dead] == 2)
{
MalaArenaT[playerid] = 1;
PBArena[playerid] = 1;
PlayerInfo[playerid][pArena] = 1;
PlayerInfo[playerid][Dead] = 2;
ResetDodWeapons(playerid);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 7652);
SetPlayerColor(playerid, COLOR_RED);
SetPlayerTeam(playerid, MALATER);
SetPlayerSkin(playerid, 223);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
GiveDodWeapon(playerid, 26, cellmax);
GiveDodWeapon(playerid, 28, cellmax);
GiveDodWeapon(playerid, 24, cellmax);
GiveDodWeapon(playerid, 34, cellmax);
new rand = random(sizeof(gSpawnMT));
SetPlayerFacingAngle(playerid, gSpawnMT[rand][2]);
SetPlayerPos(playerid, gSpawnMT[rand][0], gSpawnMT[rand][1], gSpawnMT[rand][2]); // Mala Arena Terorista
}
pawn Код:
if(PlayerInfo[playerid][Dead] == 1)
{
MalaArenaS[playerid] = 1;
PBArena[playerid] = 1;
PlayerInfo[playerid][pArena] = 1;
PlayerInfo[playerid][Dead] = 1;
ResetDodWeapons(playerid);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 7652);
SetPlayerTeam(playerid, MALASPEC);
SetPlayerColor(playerid, COLOR_YELLOW);
SetPlayerSkin(playerid, 285);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
GiveDodWeapon(playerid, 26, cellmax);
GiveDodWeapon(playerid, 28, cellmax);
GiveDodWeapon(playerid, 24, cellmax);
GiveDodWeapon(playerid, 34, cellmax);
new rand = random(sizeof(gSpawnMA));
SetPlayerFacingAngle(playerid, gSpawnMA[rand][2]);
SetPlayerPos(playerid, gSpawnMA[rand][0], gSpawnMA[rand][1], gSpawnMA[rand][2]); // Mala Arena Specijalac
}
if(PlayerInfo[playerid][Dead] == 2)
{
MalaArenaT[playerid] = 1;
PBArena[playerid] = 1;
PlayerInfo[playerid][pArena] = 1;
PlayerInfo[playerid][Dead] = 2;
ResetDodWeapons(playerid);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 7652);
SetPlayerColor(playerid, COLOR_RED);
SetPlayerTeam(playerid, MALATER);
SetPlayerSkin(playerid, 223);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
GiveDodWeapon(playerid, 26, cellmax);
GiveDodWeapon(playerid, 28, cellmax);
GiveDodWeapon(playerid, 24, cellmax);
GiveDodWeapon(playerid, 34, cellmax);
new rand = random(sizeof(gSpawnMT));
SetPlayerFacingAngle(playerid, gSpawnMT[rand][2]);
SetPlayerPos(playerid, gSpawnMT[rand][0], gSpawnMT[rand][1], gSpawnMT[rand][2]); // Mala Arena Terorista
}
pawn Код:
stock SpawnChar(playerid)
{
if(IsPlayerLoggedIn(playerid))
{
// Legit Loyalty
if(!PlayerInfo[playerid][pLoyal] && PlayerInfo[playerid][pHours] < 24) {PlayerInfo[playerid][pLoyal] = 1;}
// Safe Admin
// Tutorial
TogglePlayerControllable(playerid, 1);
// Family Strikes
if(PlayerInfo[playerid][pFam])
{
new idx = PlayerInfo[playerid][pFam];
if(FamInfo[idx][fStrikes] >= 3)
{
PlayerInfo[playerid][pFam] = 0;
PlayerInfo[playerid][pFamRank] = 0;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your family has been disbanded due to having 3 strikes, you have been autokicked from the family.");
}
}
// Website
//C4
PreloadAnimLib(playerid, "BOMBER");
PreloadAnimLib(playerid, "PED");
Pspawned[playerid] = 1;
//neons
neon[playerid] = 1;
topened[playerid] = 0;
CarHop[playerid] = 0;
SpeedHack[playerid] = 0;
sellgunlowmats[playerid] = 0;
sellgunmedmats[playerid] = 0;
sellgunhighmats[playerid] = 0;
blowgun[playerid] = 0;
// Time
TextDrawShowForPlayer(playerid, TimeTD);
TextDrawShowForPlayer(playerid, ReklamiT0);
TextDrawShowForPlayer(playerid, ReklamiT1);
TextDrawShowForPlayer(playerid, ReklamiT2);
TextDrawShowForPlayer(playerid, ReklamiT3);
// Name Color & Level & Wanted Level
SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
SetPlayerColor(playerid, TRANSPARENT_WHITE);
SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWanted]);
// Download bar
Download[playerid] = CreateProgressBar(499.00, 103.00, 107.50, 3.20, -16776961, 100.0);
SetProgressBarMaxValue(Download[playerid], 100);
SetProgressBarColor(Download[playerid], COLOR_GREEN);
// Custom Int
if(PlayerInfo[playerid][pSpawnFreeze])
{
SetTimerEx("EnterExitTimer", 5000, false, "i", playerid);
}
// Business, House and Gates Checking
if(PlayerInfo[playerid][pBiz] != 0 && strcmp(RPNU(playerid), BizInfo[PlayerInfo[playerid][pBiz]][bOwner]) || PlayerInfo[playerid][pBiz] != 0 && !strlen(BizInfo[PlayerInfo[playerid][pBiz]][bOwner]))
{
PlayerInfo[playerid][pBiz] = 0;
SendClientMessage(playerid, COLOR_WHITE, " Admin je prodao tvoji biznis dok ti nisi bio tu.");
}
if(PlayerInfo[playerid][pHouse] != 0 && strcmp(RPNU(playerid), HouseInfo[PlayerInfo[playerid][pHouse]][hOwner]) || PlayerInfo[playerid][pHouse] != 0 && !strlen(HouseInfo[PlayerInfo[playerid][pHouse]][hOwner]))
{
PlayerInfo[playerid][pHouse] = 0;
SendClientMessage(playerid, COLOR_WHITE, " Admin je prodao tvoja kuca dok ti nisi bio tu.");
}
new idx; idx = PlayerInfo[playerid][pGate][0]; // Gate slot 1
if(idx && !GateInfo[idx][gModel])
{
PlayerInfo[playerid][pGate][0] = 0;
SendClientMessage(playerid, COLOR_WHITE, " Admin je izbrisao tvoja vrata dok sa ID:(1) dok ti nisi bio tu.");
}
idx = PlayerInfo[playerid][pGate][1]; // Gate slot 2
if(idx && !GateInfo[idx][gModel])
{
PlayerInfo[playerid][pGate][1] = 0;
SendClientMessage(playerid, COLOR_WHITE, " Admin je izbrisao tvoja vrata dok sa ID:(2) dok ti nisi bio tu.");
}
idx = PlayerInfo[playerid][pGate][2]; // Gate slot 3
if(idx && !GateInfo[idx][gModel])
{
PlayerInfo[playerid][pGate][2] = 0;
SendClientMessage(playerid, COLOR_WHITE, " Admin je izbrisao tvoja vrata dok sa ID:(3) dok ti nisi bio tu..");
}
// Spawning
if(PlayerInfo[playerid][pX] == 0 && PlayerInfo[playerid][pY] == 0 && PlayerInfo[playerid][pZ] == 0 && SpawnPlayer(playerid))
{
SetPlayerPos(playerid, 1960.7507,-2178.1753,13.5469); // THE SPAWN D
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
}
else
{
SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
SetCameraBehindPlayer(playerid);
SetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
// HP and Armor
if(PlayerInfo[playerid][pHealth] <= 0) PlayerInfo[playerid][pHealth] = 1;
SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
SetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
}
// Skin
SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
// Guns
for(new i = 0; i < 13; i++)
{
if(PlayerInfo[playerid][pWeapon][i]) GiveDodWeapon(playerid, PlayerInfo[playerid][pWeapon][i], PlayerInfo[playerid][pWeaponAmmo][i]);
}
// Hospital
if(!PlayerInfo[playerid][pPrison])
{
if(PlayerInfo[playerid][pHospital])
{
if(eventdeath[playerid] == 1)
{
SetPlayerPos(playerid, eX, eY, eZ);
SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
PlayerInfo[playerid][pHospital] = 0;
SetPlayerHealth(playerid, eHP);
SetPlayerArmour(playerid, eARMOR);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "*** Tebe su ubili u eventa, vise sreca naredni event. ***");
GunsBeingRemoved[playerid] = 1;
ResetPlayerWeapons(playerid);
GunsBeingRemoved[playerid] = 1;
for(new w = 0; w < 13; w++)
{
GiveDodWeapon(playerid, PlayerInfo[playerid][pWeapon][w], PlayerInfo[playerid][pWeaponAmmo][w]);
}
eventdeath[playerid] = 0;
return 1;
}
if(dueldeath[playerid] == 1)
{
SetPlayerPos(playerid, eX, eY, eZ);
SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
PlayerInfo[playerid][pHospital] = 0;
SetPlayerHealth(playerid, eHP);
SetPlayerArmour(playerid, eARMOR);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "*** Ti si zagubio ovaj duel, vise sreca naredni duel. ***");
GunsBeingRemoved[playerid] = 1;
ResetPlayerWeapons(playerid);
GunsBeingRemoved[playerid] = 1;
for(new w = 0; w < 13; w++)
{
GiveDodWeapon(playerid, PlayerInfo[playerid][pWeapon][w], PlayerInfo[playerid][pWeaponAmmo][w]);
}
eventdeath[playerid] = 0;
// playerb
return 1;
}
Hospital[playerid] = random(2);
if(Hospital[playerid] == 0) // AllSaints
{
SetPlayerPos(playerid, 1177.5485,-1323.5773,11.0761);
SetPlayerCameraPos(playerid,1223.2250,-1289.4913,31.9257);
SetPlayerCameraLookAt(playerid,1177.5485,-1323.5773,14.0761);
}
else if(Hospital[playerid] == 1) // County General
{
SetPlayerPos(playerid, 2034.0833,-1404.6536,14.2539);
SetPlayerCameraPos(playerid,1997.1254,-1457.8685,34.8850);
SetPlayerCameraLookAt(playerid,2034.0833,-1404.6536,17.2539);
}
ResetDodWeapons(playerid);
PlayerInfo[playerid][pFacDuty] = 0;
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 0);
HospitalTime[playerid] = 30;
if(PlayerInfo[playerid][pVIP] >= 2) HospitalTime[playerid] = 1;
HospitalCountDown[playerid] = SetTimerEx("HospitalTimer", 1000, false, "d", playerid);
if(DayNoDrops == 1)
{
for (new i = 0; i < 13; i++)
{
GiveDodWeapon(playerid, DNDW[1][0], 7);
GiveDodWeapon(playerid, DNDW[2][0], 7);
GiveDodWeapon(playerid, DNDW[3][0], 7);
GiveDodWeapon(playerid, DNDW[4][0], 7);
GiveDodWeapon(playerid, DNDW[5][0], 7);
GiveDodWeapon(playerid, DNDW[6][0], 7);
GiveDodWeapon(playerid, DNDW[7][0], 7);
GiveDodWeapon(playerid, DNDW[8][0], 7);
GiveDodWeapon(playerid, DNDW[9][0], 7);
GiveDodWeapon(playerid, DNDW[10][0], 7);
GiveDodWeapon(playerid, DNDW[11][0], 7);
GiveDodWeapon(playerid, DNDW[12][0], 7);
}
}
}
}
// LSPD Duty
if(PlayerInfo[playerid][pFacDuty] && PlayerInfo[playerid][pFac] == 1)
{
SetPlayerColor(playerid, TRANSPARENT_BLUE);
}
// LSPD-Prison
if(PlayerInfo[playerid][pPrison] == 1)
{
ResetDodWeapons(playerid);
SetPlayerColor(playerid, TRANSPARENT_ORANGE);
SetPlayerInterior(playerid, 1);
new RandomCell = random(sizeof(RandomPrison));
SetPlayerFacingAngle(playerid, RandomPrison[RandomCell][3]);
TogglePlayerControllable(playerid, 0);
SetTimerEx("EnterExitTimer", 5000, false, "i", playerid);
SetPlayerPos(playerid, RandomPrison[RandomCell][0], RandomPrison[RandomCell][1], RandomPrison[RandomCell][2]);
SetCameraBehindPlayer(playerid);
}
// Admin-Prison
if(PlayerInfo[playerid][pPrison] == 2)
{
ResetDodWeapons(playerid);
SetPlayerColor(playerid, TRANSPARENT_ORANGE);
SetPlayerInterior(playerid, 2);
SetPlayerVirtualWorld(playerid, 1);
new RandomCell = random(sizeof(RandomPrison));
SetPlayerFacingAngle(playerid, RandomPrison[RandomCell][3]);
TogglePlayerControllable(playerid, 0);
SetTimerEx("EnterExitTimer", 5000, false, "i", playerid);
SetPlayerPos(playerid, RandomPrison[RandomCell][0], RandomPrison[RandomCell][1], RandomPrison[RandomCell][2]);
SetCameraBehindPlayer(playerid);
}
if(PlayerInfo[playerid][Dead] == 1)
{
MalaArenaS[playerid] = 1;
PBArena[playerid] = 1;
PlayerInfo[playerid][pArena] = 1;
PlayerInfo[playerid][Dead] = 1;
ResetDodWeapons(playerid);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 7652);
SetPlayerTeam(playerid, MALASPEC);
SetPlayerColor(playerid, COLOR_YELLOW);
SetPlayerSkin(playerid, 285);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
GiveDodWeapon(playerid, 26, cellmax);
GiveDodWeapon(playerid, 28, cellmax);
GiveDodWeapon(playerid, 24, cellmax);
GiveDodWeapon(playerid, 34, cellmax);
new rand = random(sizeof(gSpawnMA));
SetPlayerFacingAngle(playerid, gSpawnMA[rand][2]);
SetPlayerPos(playerid, gSpawnMA[rand][0], gSpawnMA[rand][1], gSpawnMA[rand][2]); // Mala Arena Specijalac
}
if(PlayerInfo[playerid][Dead] == 2)
{
MalaArenaT[playerid] = 1;
PBArena[playerid] = 1;
PlayerInfo[playerid][pArena] = 1;
PlayerInfo[playerid][Dead] = 2;
ResetDodWeapons(playerid);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 7652);
SetPlayerColor(playerid, COLOR_RED);
SetPlayerTeam(playerid, MALATER);
SetPlayerSkin(playerid, 223);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
GiveDodWeapon(playerid, 26, cellmax);
GiveDodWeapon(playerid, 28, cellmax);
GiveDodWeapon(playerid, 24, cellmax);
GiveDodWeapon(playerid, 34, cellmax);
new rand = random(sizeof(gSpawnMT));
SetPlayerFacingAngle(playerid, gSpawnMT[rand][2]);
SetPlayerPos(playerid, gSpawnMT[rand][0], gSpawnMT[rand][1], gSpawnMT[rand][2]); // Mala Arena Terorista
}
// Bank Robbery
if(PlayerInfo[playerid][pFac] == 1 && RobberyStarted)
{
TextDrawShowForPlayer(playerid, Textdraw0);
TextDrawShowForPlayer(playerid, Textdraw1);
if(BankRobbersCount == 2) {TextDrawShowForPlayer(playerid, Textdraw2);}
else if(BankRobbersCount == 3) {TextDrawShowForPlayer(playerid, Textdraw3);}
else if(BankRobbersCount == 4) {TextDrawShowForPlayer(playerid, Textdraw4);}
else if(BankRobbersCount == 5) {TextDrawShowForPlayer(playerid, Textdraw5);}
}
if(PlayerPaintballing[playerid] == 1)
{
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
GunsBeingRemoved[playerid] = 1;
ResetPlayerWeapons(playerid);
DestroyPickup(pbHealth);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
new rand = random(sizeof(PaintballSpawns));
SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]);
for (new i = 0; i < 13; i++)
{
GiveDodWeapon(playerid, pbGuns[2][0], 99999);
GiveDodWeapon(playerid, pbGuns[3][0], 99999);
GiveDodWeapon(playerid, pbGuns[4][0], 99999);
GiveDodWeapon(playerid, pbGuns[5][0], 99999);
GiveDodWeapon(playerid, pbGuns[6][0], 99999);
}
SetCameraBehindPlayer(playerid);
}
}
return 1;
}
pawn Код:
if(dialogid == AR1)
{
if(response)
{
if(listitem == 0)
{
MalaArenaS[playerid] = 1;
PBArena[playerid] = 1;
PlayerInfo[playerid][pArena] = 1;
PlayerInfo[playerid][Dead] = 1;
ResetDodWeapons(playerid);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 7652);
SetPlayerTeam(playerid, MALASPEC);
SetPlayerColor(playerid, COLOR_YELLOW);
SetPlayerSkin(playerid, 285);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
GiveDodWeapon(playerid, 26, cellmax);
GiveDodWeapon(playerid, 28, cellmax);
GiveDodWeapon(playerid, 24, cellmax);
GiveDodWeapon(playerid, 34, cellmax);
new rand = random(sizeof(gSpawnMA));
SetPlayerFacingAngle(playerid, gSpawnMA[rand][2]);
SetPlayerPos(playerid, gSpawnMA[rand][0], gSpawnMA[rand][1], gSpawnMA[rand][2]); // Mala Arena Specijalac
new str[200], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(str,sizeof(str),"[Paintball Arena] %s je usao u areni kao Specijalac!", name);
SendArenaMessage(COLOR_YELLOW,str);
}
if(listitem == 1)
{
MalaArenaT[playerid] = 1;
PBArena[playerid] = 1;
PlayerInfo[playerid][pArena] = 1;
PlayerInfo[playerid][Dead] = 2;
ResetDodWeapons(playerid);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 7652);
SetPlayerTeam(playerid, MALATER);
SetPlayerColor(playerid, COLOR_YELLOW);
SetPlayerSkin(playerid, 291);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
GiveDodWeapon(playerid, 26, cellmax);
GiveDodWeapon(playerid, 28, cellmax);
GiveDodWeapon(playerid, 24, cellmax);
GiveDodWeapon(playerid, 34, cellmax);
new rand = random(sizeof(gSpawnMT));
SetPlayerFacingAngle(playerid, gSpawnMT[rand][2]);
SetPlayerPos(playerid, gSpawnMT[rand][0], gSpawnMT[rand][1], gSpawnMT[rand][2]); // Mala Arena Terror
new str[200], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(str,sizeof(str),"[Paintball Arena] %s je usao u areni kao Terorista!", name);
SendArenaMessage(COLOR_YELLOW,str);
}
}
Re: Problem with PlayerSpawn. -
I made few changes untill i wait 24 hours the thread is updated, but i cant still figure out why when someone is killing me im not respawning in the arena im spawning into the Hospital, but if i kill by self like explode or fire i will spawn in arena.