Auto-Spawn Problem
#1

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;*/

  }
}
Reply
#2

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
Reply
#3

Obviously...
Reply
#4

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

Yea maybe i'll try that
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)