SA-MP Forums Archive
Auto-Spawn Problem - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Auto-Spawn Problem (/showthread.php?tid=200564)



Auto-Spawn Problem - Steven82 - 18.12.2010

Alright so i have been having trouble with auto spawning for the script i am currently making for a possible release the these forums. So, im wanting to have it on the player login to it'll auto spawn them with there saved skins and guns etc.

Here is what im trying to do, but whenever i spawn it's killing me and tele'ing me to the 0.0,0.0,0.0 cordnites(blue berry).

pawn Код:
SetSpawnInfo(playerid, dini_Int(file, "Faction"), dini_Int(file, "Skin"), PlayerStats[playerid][pPosX], PlayerStats[playerid][pPosY], PlayerStats[playerid][pPosZ], 0.0, 0, 0, 0, 0, 0, 0);

SpawnPlayer(playerid); // This is right after that.
So i feel like a total noob and don't know why this isn't working. I'll post my on player spawn right now.

pawn Код:
new Float:Health = PlayerStats[playerid][pHealth], Float:Armour = PlayerStats[playerid][pArmour];
if(LoggedIn[playerid] == 1)
{
 SetPlayerColor(playerid, COLOR_WHITE);
 SetPlayerHealth(playerid, Health);
 SetPlayerArmour(playerid, Armour);

  if(gDead[playerid] == 1)
  {
    /*SetPlayerPos(playerid, 0.0, 0.0, 0.0);
    SetPlayerHealth(playerid, 50.0);
    gDead[playerid] = 0;*/

  }
}



Re: Auto-Spawn Problem - blackwave - 18.12.2010

Did you load your dini file? like this:

pawn Код:
new file[256]; new name[30];
GetPlayerName(playerid,name,sizeof(name));
format(file,sizeof(file),"%s.ini",name);
PlayerStats[pPosX] = dini_Int(file,"pPosX");
On my I do it right as it is, setting playerinfo on the /login command, with last coordinates he was at before disconnect


Re: Auto-Spawn Problem - Steven82 - 18.12.2010

Obviously...


Re: Auto-Spawn Problem - WillyP - 18.12.2010

Hmm. Maybe with matching IP's, then OnPlayerConnect, if the IP's match, SetSpawnInfo, then OnPlayerRequestClass, SpawnPlayer?


Re: Auto-Spawn Problem - Steven82 - 18.12.2010

Yea maybe i'll try that