SA-MP Forums Archive
My stuff under on player spawn doesn't work corretly ;( - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: My stuff under on player spawn doesn't work corretly ;( (/showthread.php?tid=304552)



Don't need anymore - liinor - 18.12.2011

Don't need anymore


Re: My stuff under on player spawn doesn't work corretly ;( - robintjeh - 18.12.2011

pawn Код:
public OnPlayerSpawn(playerid)
{
if(spawned[playerid] == 0)
{
StopAudioStreamForPlayer(playerid);
return 1;
}
SetPlayerSpecialAction(playerid,0);
PlayerPlaySound(playerid,1063,0.0,0.0,0.0);
SetTimerEx("Zonas",1000,true,"i",playerid);
spawned[playerid]=1;
new PName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PName, MAX_PLAYER_NAME);
format(AccountFile, sizeof(AccountFile), PLAYERFILE, PName);
if(fexist(AccountFile)) {
if(dini_Int(AccountFile, "randomspawn") == 1)
{
SetCameraBehindPlayer(playerid);
LoadData(playerid);
new rand = random(sizeof(RandomSpawn));
GivePlayerMoney(playerid,950);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);

SetPlayerFacingAngle(playerid, RandomSpawn[rand][3]);
return 1;
}

if(dini_Int(AccountFile, "randomspawn") == 0)
{
SetCameraBehindPlayer(playerid);
SendClientMessage(playerid,COLOR_GREY,"* You have returned to {345BBF}your last positions.");
SetPlayerPos(playerid, dini_Float(AccountFile, "Pos_X"), dini_Float(AccountFile, "Pos_Y"), dini_Float(AccountFile, "Pos_Z"));
SetPlayerInterior(playerid, dini_Int(AccountFile, "Interior"));
SetPlayerVirtualWorld(playerid,0);
LoadData(playerid);
return 1;
}

if(dini_Int(AccountFile, "Parrot") == 1)
{
SetPlayerAttachedObject(playerid,INDEX,19078,1,0.3 20722,-0.067912,-0.165151,0.000000,0.000000,0.000000,1.000000,1.000 000,1.000000); // Parrot
return 1;
}
SetPlayerArmour(playerid,dini_Int(AccountFile, "Armour"));

}
muisa[playerid]=0;

if(spawned[playerid] == 1)
{
TextDrawHideForPlayer(playerid,Textdraw41[playerid]);
TextDrawHideForPlayer(playerid,Textdraw57);
TextDrawHideForPlayer(playerid,wbt[playerid]);
TextDrawHideForPlayer(playerid, Textdraw153[playerid]);

return 1;
}


if(specoff[playerid] == 1)
{
LoadData(playerid);
SetPlayerPos(playerid,X5[playerid],Y5[playerid],Z5[playerid]);
SetPlayerInterior(playerid,interiorid5[playerid]);
return 1;
}

if(dm1[playerid] == 1)
{
SetPlayerVirtualWorld(playerid, 1);
SetPlayerInterior(playerid,0);
new dmspawnz = random(sizeof(dm1spawns));
dm1[playerid]=1;
SetPlayerPos(playerid, dm1spawns[dmspawnz][0], dm1spawns[dmspawnz][1],dm1spawns[dmspawnz][2]);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,27,4500);
GivePlayerWeapon(playerid,31,5000);
SetCameraBehindPlayer(playerid);
return 1;
}
if(dm2[playerid] == 1)
{
SetPlayerVirtualWorld(playerid, 1);
SetPlayerInterior(playerid,0);
new dmspawnz = random(sizeof(dm2spawns));
dm2[playerid]=1;
SetPlayerPos(playerid, dm2spawns[dmspawnz][0], dm2spawns[dmspawnz][1],dm2spawns[dmspawnz][2]);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,24,5000);
GivePlayerWeapon(playerid,34,5000);
SetCameraBehindPlayer(playerid);
return 1;
}
if(dm3[playerid] == 1)
{
SetPlayerVirtualWorld(playerid, 1);
SetPlayerInterior(playerid,0);
new dmspawnz = random(sizeof(dm3spawns));
dm3[playerid]=1;
SetPlayerPos(playerid, dm3spawns[dmspawnz][0], dm3spawns[dmspawnz][1],dm3spawns[dmspawnz][2]);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,31,5000);
GivePlayerWeapon(playerid,32,5000);
GivePlayerWeapon(playerid,26,5000);
SetCameraBehindPlayer(playerid);
return 1;
}



Don't need anymore - liinor - 18.12.2011

Don't need anymore


Re: My stuff under on player spawn doesn't work corretly ;( - liinor - 03.01.2012

This problem was solved by Nero_3D.