SA-MP Forums Archive
Script doesn't save last pos and skin - 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: Script doesn't save last pos and skin (/showthread.php?tid=455040)



Script doesn't save last pos and skin - Sellize - 31.07.2013

No idea what i'm doing wrong here.
When I quit the game and join back in I will be on the beginners spawnpoint and also my skin will be changed to CJ
Script: http://pastebin.com/GW7H3LSi

Please explain what i did wrong


Re: Script doesn't save last pos and skin - Sellize - 31.07.2013

Please this is very urgent


Re: Script doesn't save last pos and skin - dEcooR - 31.07.2013

Try to remove the setting skin from the spawn if you are setting it after loggin


Re: Script doesn't save last pos and skin - Ceez - 31.07.2013

Create a pModel / pSkin / pChar
Every time that you change a player's skin use like
pawn Код:
CMD:setskin(playerid, params[])
{
      new amount;
      if(sscanf(params, "ui", giveplayerid, amount)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setskin [playerid] [skinid]");
      PlayerInfo[giveplayerid][pModel] = amount; // amount is the skin id, look above at the if(sscanf
      SetPlayerSkin(giveplayerid, amount); // the original SetPlayerSkin just with pModel above it so it will have the same value and will save.
      return 1;
}
Then go under OnPlayerSpawn
pawn Код:
SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
      SendClientMessage(playerid, COLOR_WHITE, "Your skin was changed to the saved skin!");
NOTE: You'll need a saving system like dini so the pModel will save.
Good luck!


Re: Script doesn't save last pos and skin - Calabresi - 31.07.2013

I cannot see you have used "LoadUser_data" function within your script. Try loading player data first before setting their skin on OnPlayerSpawn, for example you can load their data after login.