29.07.2012, 05:41
So, im using this script currently: https://sampforum.blast.hk/showthread.php?tid=279927
I have modified it alot, it saves except the player's position. The default spawn everytime you log in or die(I can fix that)is at the airport. I could remove that but I would fall through the ground at Blueberry, I have tried tutorial's, etc but I can't get the player's position to save:/
If someone could help me out with the code, or anything like that please reply!
Thank you!
Matty
OnPlayerConnect:
Other stuff maybe needed:
I have modified it alot, it saves except the player's position. The default spawn everytime you log in or die(I can fix that)is at the airport. I could remove that but I would fall through the ground at Blueberry, I have tried tutorial's, etc but I can't get the player's position to save:/
If someone could help me out with the code, or anything like that please reply!
Thank you!
Matty
OnPlayerConnect:
Quote:
public OnPlayerConnect(playerid) { if(!IsValidName(playerid)) { SCM(playerid,COLOR_RED,"Please change your name into the following format: First_Last(name)."); Kick(playerid); } new string[128]; new plname[MAX_PLAYER_NAME]; GetPlayerName(playerid, plname, sizeof(plname)); PlayerInfo[playerid][pLevel] = 0; PlayerInfo[playerid][pCash] = 0; PlayerInfo[playerid][pDriveLic] = 0; PlayerInfo[playerid][pVip] = 0; PlayerInfo[playerid][pAdmin] = 0; PlayerInfo[playerid][pTester] = 0; PlayerInfo[playerid][pSpawn] = 0; PlayerInfo[playerid][pSex] = 0; RefuelTime[playerid] = 0; TrackCar[playerid] = 0; PlayerInfo[playerid][pAge] = 0; PlayerInfo[playerid][pOrigin] = 0; PlayerInfo[playerid][pModel] = 23; PlayerInfo[playerid][pLocked] = 0; PlayerInfo[playerid][pExp] = 0; PlayerInfo[playerid][pWarns] = 0; PlayerNeedsHelp[playerid] = 0; Mobile[playerid] = 255; PlayerInfo[playerid][pMuted] = 0; PlayerInfo[playerid][pMuteTime] = 0; gPlayerTutorialing[playerid] = 0; INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); format(string, sizeof(string), "/Users/%s.ini", plname); |
Quote:
enum pInfo { pPass, pLevel, pSex, pAge, pOrigin, pPlace, pCash, pExp, pAdmin, pNumber, pTester, pWarns, pSelected, pMuted, pMuteTime, pFirstJoined, pModel, pVip, pSpawn, pLocked, pDriveLic }; new PlayerInfo[MAX_PLAYERS][pInfo]; forward LoadUser_data(playerid,name[],value[]); public LoadUser_data(playerid,name[],value[]) { INI_Int("Password",PlayerInfo[playerid][pPass]); INI_Int("Level",PlayerInfo[playerid][pLevel]); INI_Int("Cash",PlayerInfo[playerid][pCash]); INI_Int("Admin",PlayerInfo[playerid][pAdmin]); INI_Int("Age",PlayerInfo[playerid][pAge]); INI_Int("Origin",PlayerInfo[playerid][pOrigin]); INI_Int("Sex",PlayerInfo[playerid][pSex]); INI_Int("Model",PlayerInfo[playerid][pModel]); INI_Int("DriveLic",PlayerInfo[playerid][pDriveLic]); INI_Int("Place",PlayerInfo[playerid][pPlace]); INI_Int("Exp",PlayerInfo[playerid][pExp]); INI_Int("Admin",PlayerInfo[playerid][pAdmin]); INI_Int("Number",PlayerInfo[playerid][pNumber]); INI_Int("Tester",PlayerInfo[playerid][pTester]); INI_Int("Warns",PlayerInfo[playerid][pWarns]); INI_Int("Selected",PlayerInfo[playerid][pSelected]); INI_Int("Muted",PlayerInfo[playerid][pMuted]); INI_Int("MuteTime",PlayerInfo[playerid][pMuteTime]); INI_Int("FirstJoined",PlayerInfo[playerid][pFirstJoined]); INI_Int("Vip",PlayerInfo[playerid][pVip]); INI_Int("Spawn",PlayerInfo[playerid][pSpawn]); INI_Int("Locked",PlayerInfo[playerid][pLocked]); return 1; } stock UserPath(playerid) { new string[128],playername[MAX_PLAYER_NAME]; GetPlayerName(playerid,playername,sizeof(playernam e)); format(string,sizeof(string),PATH,playername); return string; } |