Script doesn't save last pos and skin
#1

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

Please this is very urgent
Reply
#3

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

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!
Reply
#5

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)