PDA

View Full Version : Weird spawn


kbalor
15/10/2014, 07:48 PM
Hi. I've been experiencing this weird spawn. What I did was I opened the server once the first time I died and it puts me back to Class selection, then after dying again for the second time it didn't put me back to class selection but in the right place where I usually spawn. the third time I died it puts me back again to the normal is spawn point. So as fat as I see there were no issue with 2nd and 3rd spawn after dying but the 1st one has.

So what could be the problem?

EDIT: after restarting the server it happened again.

RockyGamer
15/10/2014, 07:57 PM
Maybe someone set the gravity too high.

Abagail
15/10/2014, 08:10 PM
Maybe it's scripted that way...? Unless you can give us some relevant code/information we can't help.

kbalor
15/10/2014, 08:23 PM
Maybe someone setted gravity too high. no man, gravity has nothing to do with it lol.

Maybe it's scripted that way...? Unless you can give us some relevant code/information we can't help.

Here I can show you some of the callbacks might affect. thanks for the reply btw.

EDIT: I even removed the forceclassselection but still the same

public OnPlayerSpawn(playerid)
{

PlayerInfo2[playerid][SpawnAngle] = 0.0; //so when you leave and another player comes, the camera will start from start
PlayerInfo2[playerid][SpawnDance] = true; //to not execute to much timers
KillTimer( PlayerInfo2[playerid][SpawnTimer] ); //to kill it, since its useless now
PlayerPlaySound(playerid, 1186, 0.0, 0.0, 0.0); // (blank sound) to shut the music up
SetCameraBehindPlayer(playerid); //to prevent some bugs
//DriftExit(playerid);
StopAudioStreamForPlayer(playerid);
SetPlayerHealth(playerid, 100);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
PInfo[playerid][InParkour] = 0;
PInfo[playerid][Spawned] = 1;
if(IsValidDynamic3DTextLabel(PInfo[playerid][VipLabel]) && PInfo[playerid][Level] != 1)
DestroyDynamic3DTextLabel(PInfo[playerid][VipLabel]);
if(PInfo[playerid][InDM] != 0)
{
if(PInfo[playerid][InDM] == 1)
{
cmd_mdm(playerid,"");
GivePlayerWeapon(playerid, 38, 65535);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COL_GREY, "Use /iwanthome if you wish to exit the Minigun madness.");
}
else if(PInfo[playerid][InDM] == 2)
{
cmd_glassmadness(playerid,"");
SendClientMessage(playerid, COL_GREY, "Use /iwanthome if you wish to exit the Glass madness.");
}
else if(PInfo[playerid][InDM] == 3)
{
cmd_shipmadness(playerid,"");
GivePlayerWeapon(playerid, 29, 130);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COL_GREY, "Use /iwanthome if you wish to exit the Ship madness.");
}
else if(PInfo[playerid][InDM] == 5)
{
new RandomPos = random(sizeof RCWar);
SetPlayerPos(playerid,RCWar[RandomPos][0],RCWar[RandomPos][1],RCWar[RandomPos][2]);
SetPlayerFacingAngle(playerid,RCWar[RandomPos][3]);
SetPlayerInterior(playerid,10);
SendClientMessage(playerid, COL_GREY, "Use /iwanthome if you wish to exit the RC war.");
}
else if(PInfo[playerid][InDM] == 6)
{
cmd_deagledm(playerid,"");
SendClientMessage(playerid, COL_GREY, "Use /iwanthome if you wish to exit the Deagle DM");
}
else if(PInfo[playerid][InDM] == 7)
{
cmd_jetpackdm(playerid, "");
SendClientMessage(playerid, COL_GREY, "Use /iwanthome if you wish to exit the Jetpack DM");
}
else if(PInfo[playerid][InDM] == 8)
{
cmd_mhdm(playerid, "");
SendClientMessage(playerid, COL_GREY, "Use /iwanthome if you wish to exit the Mafia House DM");
}
else if(PInfo[playerid][InDM] == 17)
{
cmd_sodm(playerid, "");
SendClientMessage(playerid, COL_GREY, "Use /iwanthome if you wish to exit the Sawn-Off shotgun DM");
}
else if(PInfo[playerid][InDM] == 18)
{
cmd_pdm(playerid, "");
SendClientMessage(playerid, COL_GREY, "Use /iwanthome if you wish to exit the Pistol DM");
}
else if(PInfo[playerid][InDM] == 19)
{
cmd_rhinodm(playerid, "");
SendClientMessage(playerid, COL_GREY, "Use /iwanthome if you wish to exit the Rhino DM");
}
else if(PInfo[playerid][InDM] == 10)
OnDialogResponse(playerid, CTdialog, 1, 0, "");
else if(PInfo[playerid][InDM] == 11)
OnDialogResponse(playerid, CTdialog, 1, 1, "");
else if(PInfo[playerid][InDM] == 12)
OnDialogResponse(playerid, Teamsdialog, 1, 0, "");
else if(PInfo[playerid][InDM] == 13)
OnDialogResponse(playerid, Teamsdialog, 1, 1, "");
else if(PInfo[playerid][InDM] == 14)
OnDialogResponse(playerid, Teamsdialog, 1, 2, "");
else if(PInfo[playerid][InDM] == 15)
OnDialogResponse(playerid, Teamsdialog, 1, 3, "");
else if(PInfo[playerid][InDM] == 16)
{
new rand = random(9);
SetPlayerPos(playerid, RandGG[rand][0], RandGG[rand][1], RandGG[rand][2]);
SetPlayerFacingAngle(playerid, RandGG[rand][3]);
SetPlayerWorldBounds(playerid, -1274.2817, -1358.5095, 2575.6509, 2472.3486);
SetCameraBehindPlayer(playerid);

GivePlayerWeapon(playerid, 4, 1);
GivePlayerWeapon(playerid, Weaps[PInfo[playerid][Tire]], 65535);

PInfo[playerid][Dead] = false;
PInfo[playerid][pw] = true;
SetPlayerHealth(playerid, 20);
SetPlayerVirtualWorld(playerid, 10);
}
}
else
{
GivePlayerWeapon(playerid,23,100);
GivePlayerWeapon(playerid,29,100);
GivePlayerWeapon(playerid,25,150);
GivePlayerWeapon(playerid, 4, 1);

LoadObjects(playerid,0);

if(PInfo[playerid][SpawnPoint] == 0)
{
new gRand = random(sizeof RandomSpawns);
SetPlayerPos(playerid,RandomSpawns[gRand][SX],RandomSpawns[gRand][SY],RandomSpawns[gRand][SZ]);
SetPlayerFacingAngle(playerid,RandomSpawns[gRand][SA]);
SetPlayerWorldBounds(playerid,20000.0000, -20000.0000, 20000.0000, -20000.0000);
}
else
{
if(PInfo[playerid][SpawnPoint] == 2)//lvair
{
cmd_lva(playerid,"");
}
}
if(PInfo[playerid][FirstSpawn] == 1)
{
if(PInfo[playerid][Color] != 0)
OnDialogResponse(playerid, Colorsdialog, 1, PInfo[playerid][Color]-1, "");

TextDrawHideForPlayer(playerid,Textdraw[0]);
TextDrawHideForPlayer(playerid,Textdraw[1]);
TextDrawHideForPlayer(playerid,Textdraw[2]);
TextDrawHideForPlayer(playerid,Textdraw[3]);
TextDrawHideForPlayer(playerid,Textdraw[4]);
TextDrawHideForPlayer(playerid,Textdraw[5]);
TextDrawHideForPlayer(playerid,Textdraw[6]);
TextDrawHideForPlayer(playerid,Textdraw[7]);
jBanCheck(playerid);
PInfo[playerid][FirstSpawn] = 0;
}
if(PInfo[playerid][Skin] != -1 && GetPlayerSkin(playerid) != PInfo[playerid][Skin])
SetSpawnInfo(playerid,0,PInfo[playerid][Skin],0,0,0,0,0,0,0,0,0,0), SetPlayerSkin(playerid,PInfo[playerid][Skin]);

if(PInfo[playerid][Spawnweap] != 0 && PInfo[playerid][Spawnweap] != 16)
{
GivePlayerWeapon(playerid,PInfo[playerid][Spawnweap],250);
}
else if(PInfo[playerid][Spawnweap] == 16)
{
SendClientMessage(playerid,COL_GREEN," Spawn Weapon "CBLUE"You have received some "CWHITE"["CORANGE"Grenades"CWHITE"] "CBLUE"with "CWHITE"["CORANGE"4"CWHITE"] "CBLUE"of ammo");
GivePlayerWeapon(playerid,PInfo[playerid][Spawnweap],4);
}
PlaySound(playerid,1063);
if(PInfo[playerid][Level] > 0)
SetPlayerArmour(playerid,100);
}
return 1;
}


public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
PInfo[playerid][Deaths]++;
PInfo[playerid][Spawned] = 0;
PInfo[playerid][kSpree] = 0;
if(IsPlayerConnected(killerid))
{
SInfo[ServerKills]++;
if(IsPlayerInAnyVehicle(killerid))
{
new vID = GetPlayerVehicleID(killerid);
new Float:pX, Float:pY, Float:pZ;
if(IsHeli(GetVehicleModel(vID)))
{
GetPlayerPos(killerid,pX,pY,pZ);
DestroyVehicle(vID);
SetPlayerScore(killerid,GetPlayerScore(killerid)-2);
GivePlayerMoney(killerid,-2000);
SetPlayerPos(killerid,pX,pY,pZ+25);
}
}
if(PInfo[killerid][InDM] > 0)
{
GivePlayerMoney(killerid, 1000);
if(PInfo[playerid][InDM] != 0)
{
if(PInfo[killerid][InDM] != PInfo[playerid][InDM])
{
new string[30];
if(PInfo[killerid][InDM] == 12)
{
Grovekills++;
format(string,sizeof string,"Grove kills: %i",Grovekills);
UpdateDynamic3DTextLabelText(Grovelabel,GROVECOLOR ,string);
}
else if(PInfo[killerid][InDM] == 13)
{
Vagoskills++;
format(string,sizeof string,"Vagos kills: %i",Vagoskills);
UpdateDynamic3DTextLabelText(Vagoslabel,VAGOSCOLOR ,string);
}
else if(PInfo[killerid][InDM] == 14)
{
Ballaskills++;
format(string,sizeof string,"Ballas kills: %i",Ballaskills);
UpdateDynamic3DTextLabelText(Ballaslabel,BALLASCOL OR,string);
}
else if(PInfo[killerid][InDM] == 15)
{
Aztecskills++;
format(string,sizeof string,"Aztecs kills: %i",Aztecskills);
UpdateDynamic3DTextLabelText(Aztecslabel,AZTECSCOL OR,string);
}
}
}
}
SetPlayerScore(killerid,GetPlayerScore(killerid)+1 );
PInfo[killerid][Kills]++;
PInfo[killerid][kSpree]++;
if(PInfo[killerid][kSpree] > 3)
{
if(PInfo[killerid][kSpree] == 5)
{
new Float:armour;
SendClientMessage(killerid,COL_YELLOW," You got a killstreak of 5 kills! (+5 score, +5 armour and +1 SP)");
SetPlayerScore(killerid,GetPlayerScore(killerid)+5 );
GetPlayerArmour(killerid, armour);
SetPlayerArmour(killerid,armour+5);
SendFMessageToAll(COL_RED,"[KILLSTREAK]{E1DB00} %s is on a killstreak with 5 kills in a row!",GetPName(killerid));
GivePlayerSP(killerid,1);
PlaySound(playerid,1132);
}
else if(PInfo[killerid][kSpree] == 10)
{
new Float:armour;
SendClientMessage(killerid,COL_YELLOW," You got a killstreak of 10 kills! (+10 score, +10 armour and +2 SP)");
SetPlayerScore(killerid,GetPlayerScore(killerid)+1 0);
GetPlayerArmour(killerid, armour);
SetPlayerArmour(killerid,GetPlayerArmour(killerid, armour)+10);
SendFMessageToAll(COL_RED,"[KILLSTREAK]{E1DB00} %s is on a killstreak with 10 kills in a row!",GetPName(killerid));
GivePlayerSP(killerid,2);
PlaySound(playerid,1132);
}
else if(PInfo[killerid][kSpree] == 20)
{
new Float:armour;
SendClientMessage(killerid,COL_YELLOW," You got a killstreak of 20 kills! (+20 score, +20 armour, +5 SP, +m4 with 100 bullets)");
SetPlayerScore(killerid,GetPlayerScore(killerid)+2 0);
GetPlayerArmour(killerid, armour);
SetPlayerArmour(killerid,armour+20);
GivePlayerWeapon(killerid,31,100);
SendFMessageToAll(COL_RED,"[KILLSTREAK]{E1DB00} %s is on a killstreak with 20 kills in a row!",GetPName(killerid));
GivePlayerSP(killerid,5);
PlaySound(playerid,1132);
}
else if(PInfo[killerid][kSpree] == 50)
{
new Float:armour;
SendClientMessage(killerid,COL_YELLOW," You got a killstreak of 50 kills! (+100 score, +100 armour, +8 SP, +m4 with 100 bullets)");
SetPlayerScore(killerid,GetPlayerScore(killerid)+1 00);
GetPlayerArmour(killerid, armour);
SetPlayerArmour(killerid,armour+100);
GivePlayerWeapon(killerid,31,100);
SendFMessageToAll(COL_RED,"[KILLSTREAK]{E1DB00}"CRED"Wow!{E1DB00} %s is on a killstreak with 50 kills in a row!",GetPName(killerid));
GivePlayerSP(killerid,8);
PlaySound(playerid,1132);
}
}
GameTextForPlayerEx(killerid,"~g~~h~Killing spree: ~r~~h~%i",3000,4,PInfo[killerid][kSpree]);
}
if(PInfo[playerid][Joined] == 1)
{
EndRaceForPlayer(playerid);
SendFMessageToAll(COL_YELLOW,"%s has died while in "CRED"race"CYELLOW", so he has automatically been "CRED"disqualified"CYELLOW"!",GetPName(playerid));
if(JoinCount == 0)
{
EndRace();
}
}
return 1;
}

public OnPlayerRequestSpawn(playerid)
{
if(PInfo[playerid][Logged] == 0 && PInfo[playerid][Regged] == 1) return 0;

SetTimer("Bot",20000,true);
SetTimer("StartNewRace",150000,false);
SetTimer("StartReactionTest",180000,false);
TextDrawShowForPlayer(playerid,InfoTD);
TextDrawShowForPlayer(playerid,WebsiteTD);
TextDrawShowForPlayer(playerid,HelpBotTD);
TextDrawShowForAll(TPInfo);
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, player_x,player_y,player_z);
SetPlayerFacingAngle(playerid, player_angle);
SetPlayerCameraPos(playerid, camera_x,camera_y,camera_z);
SetPlayerCameraLookAt(playerid, player_x,player_y,player_z);
ApplyAnimation(playerid,"DANCING","DNCE_M_B",4.0,1,0,0,0,-1); //smooth dancing. It's most fitting to the music
//making sure the timer gets executed only once, so the camera doesn't go to fast
if (PlayerInfo2[playerid][SpawnDance]) PlayerInfo2[playerid][SpawnTimer] = SetTimerEx("MoveCamera", moving_speed, true, "i", playerid);
PlayerInfo2[playerid][SpawnDance] = false; //preventing the timer to execute again
return 1;
}