Please help, dini & pickups arent working for me :S
#1

These are probably some silly errors by me, but here is what happens...

*DINI problem*
It won't save, but it will load. I get no errors though.
I have managed to make myself spawn at a custom location, by pasting the coords into the stats file.
-It does save the password (I registered, and can log in).

Fixed! I forgot to put sPlayerInfo[playerid][SPAWNED] = true; under OnPlayerSpawn :P

*PICKUP problem*
as you can see, I created the pickup (outside LSPD), but it won't show when I go ingame.

Fixed! Problem was that I had the virtual world set to 200 (mixed up functions)

I have coded with PAWN for a while now. I don't know what is going on here, because my other server (Ultimate Freeroam) uses the same system, also created by me (minus the seperate functions to save and load stats), and it works fine.

NOTE: There is much more to this script, I have removed everything except what is or may be related to the account system.

Код:
#include <a_samp>
#include <dini>
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_ORANGE 0xFF8000FF
#define COLOR_LIGHTBLUE 0x00F0AEFF
#define COLOR_WHITE 0xFFFFFFAA
//Dialogs
#define NEWCOMERS 0
#define AGREEMENT 1
#define LOGIN 2
#define REGISTER 3
#define CHANGEPASSWORD 4
//sPlayerInfo
#define SPAWNED 0
#define KILLS 1
#define DEATHS 2
#define WARNINGS 3
#define MUTED 4
#define KICKED 5
#define CHOPSHOP 6
#define BOMBSHOP 7
//8
#define INTERIOR 9
#define WEAPON0 10
#define WEAPON1 11
#define WEAPON2 12
#define WEAPON3 13
#define WEAPON4 14
#define WEAPON5 15
#define WEAPON6 16
#define WEAPON7 17
#define WEAPON8 18
#define WEAPON9 19
#define WEAPON10 20
#define WEAPON11 21
#define WEAPON12 22
#define PHONENUMBER 23
#define DRUGS 24
//25, 26
#define CAR 27
#define CARCOL1 28
#define CARCOL2 29
#define CARFUEL 30
#define CARSPOILER 31
#define CARHOOD 32
#define CARROOF 33
#define CARSIDESKIRT 34
#define CARLAMPS 35
#define CARNITRO 36
#define CAREXHAUST 37
#define CARWHEELS 38
#define CARSTEREO 39
#define CARHYDRAULICS 40
#define CARFRONTBUMPER 41
#define CARREARBUMPER 42
#define CARVENTLEFT 43
#define CARVENTRIGHT 44
#define JOB 45
#define MATERIALS 46
#define DRUGSEEDS 47
#define ADMIN 48
#define FROZEN 49
#define BANKMONEY 50
#define PASSPORT 51
#define DRIVERLICENSE 52
#define BOATLICENSE 53
#define TRUCKLICENSE 54
#define FISHINGLICENSE 55
#define WEAPONLICENSE 56
#define ELECTRICALQUALIFICATION 57
#define MECHANICQUALIFICATION 58
#define LAWQUALIFICATION 59
#define MEDICINEQUALIFICATION 60
#define REALESTATEQUALIFICATION 61
#define SECURITYQUALIFICATION 62
#define WEAPON0AMMO 63
#define WEAPON1AMMO 64
#define WEAPON2AMMO 65
#define WEAPON3AMMO 66
#define WEAPON4AMMO 67
#define WEAPON5AMMO 68
#define WEAPON6AMMO 69
#define WEAPON7AMMO 70
#define WEAPON8AMMO 71
#define WEAPON9AMMO 72
#define WEAPON10AMMO 73
#define WEAPON11AMMO 74
#define WEAPON12AMMO 75
#define JAILED 76
#define CELL 77
//sPlayerInfo2
#define POSX 0
#define POSY 1
#define POSZ 2
#define ANGLE 3
#define HEALTH 4
#define ARMOUR 5
//78
#define AUTHED 79
#define SKIN 80
#define MONEY 81
#define TASER 82
//sPlayerCar
#define CARPLATE 0
#define CARHEALTH 1
#define CARPANELS 2
#define CARDOORS 3
#define CARLIGHTS 4
#define CARTIRES 5
//sVehicleInfo
#define BOMB 0
//Jobs
#define NONE 0
#define POLICE 1
#define SWAT 2
#define FBI 3
#define MEDIC 4
#define MECHANIC 5
#define ELECTRICIAN 6
#define FIREFIGHTER 7
#define ARMSDEALER 8
#define DRUGDEALER 9
#define LAWYER 10
#define FISHERMAN 11
#define REALESTATE 12
#define SECURITY 13
#define BODYGUARD 14
#define PILOT 15
#define BUSDRIVER 16
#define TAXIDRIVER 17
#define INSTRUCTOR 18
#define TEACHER 19
#define ARMY 20
#define FARMER 21
#define DELIVERY 22
#define TRUCKER 23
//Pickups
#define POLICESTATION 0
//Other
#define TIME_UPDATE 120000
forward StatsUpdate(playerid);
forward SaveStats(playerid);
forward LoadStats(playerid);
forward ResetStats(playerid);
forward PDRespawn();
new sPlayerInfo[MAX_PLAYERS][128];
new Float:sPlayerInfo2[MAX_PLAYERS][16];
new sPlayerCar[MAX_PLAYERS][6][256];
new statauto[MAX_PLAYERS];
new pickup[64];
//------------------------------------------------------------------------------
main()
{
	print("\n-----------------------------------------------------------");
	print("OWN3D Roleplay vW.I.P - © 2010 MW2_OWN3D - mw2_own3d@hotmail.com");
	print("-----------------------------------------------------------\n");
}
//------------------------------------------------------------------------------
public OnPlayerSpawn(playerid)
{
	PlayerPlaySound(playerid, 1098,0,0,0);
	SetPlayerWorldBounds(playerid,999999999,-999999999,999999999,-999999999);
	TogglePlayerClock(playerid, true);
	if(sPlayerInfo[playerid][AUTHED]) {
	    if(sPlayerInfo[playerid][SKIN] >= 0) SetPlayerSkin(playerid,sPlayerInfo[playerid][SKIN]);
	    if(sPlayerInfo2[playerid][HEALTH] != 0) SetPlayerHealth(playerid,sPlayerInfo[playerid][HEALTH]);
	    if(sPlayerInfo2[playerid][ARMOUR] != 0) SetPlayerArmour(playerid,sPlayerInfo[playerid][ARMOUR]);
	    if(sPlayerInfo2[playerid][POSX] != 0 && sPlayerInfo2[playerid][POSY] != 0 && sPlayerInfo2[playerid][POSZ] != 0) SetPlayerPos(playerid,sPlayerInfo2[playerid][POSX],sPlayerInfo2[playerid][POSY],sPlayerInfo2[playerid][POSZ]);
	    if(sPlayerInfo[playerid][INTERIOR] != 0) SetPlayerInterior(playerid,sPlayerInfo[playerid][INTERIOR]);
	    if(sPlayerInfo2[playerid][ANGLE] != 0) SetPlayerFacingAngle(playerid,sPlayerInfo[playerid][ANGLE]); SetCameraBehindPlayer(playerid);
	    ResetPlayerWeapons(playerid);
	    GivePlayerWeapon(playerid,sPlayerInfo[playerid][WEAPON0],sPlayerInfo[playerid][WEAPON0AMMO]);
	    GivePlayerWeapon(playerid,sPlayerInfo[playerid][WEAPON1],sPlayerInfo[playerid][WEAPON1AMMO]);
	    GivePlayerWeapon(playerid,sPlayerInfo[playerid][WEAPON2],sPlayerInfo[playerid][WEAPON2AMMO]);
	    GivePlayerWeapon(playerid,sPlayerInfo[playerid][WEAPON3],sPlayerInfo[playerid][WEAPON3AMMO]);
	    GivePlayerWeapon(playerid,sPlayerInfo[playerid][WEAPON4],sPlayerInfo[playerid][WEAPON4AMMO]);
	    GivePlayerWeapon(playerid,sPlayerInfo[playerid][WEAPON5],sPlayerInfo[playerid][WEAPON5AMMO]);
	    GivePlayerWeapon(playerid,sPlayerInfo[playerid][WEAPON6],sPlayerInfo[playerid][WEAPON6AMMO]);
	    GivePlayerWeapon(playerid,sPlayerInfo[playerid][WEAPON7],sPlayerInfo[playerid][WEAPON7AMMO]);
	    GivePlayerWeapon(playerid,sPlayerInfo[playerid][WEAPON8],sPlayerInfo[playerid][WEAPON8AMMO]);
	    GivePlayerWeapon(playerid,sPlayerInfo[playerid][WEAPON9],sPlayerInfo[playerid][WEAPON9AMMO]);
	    GivePlayerWeapon(playerid,sPlayerInfo[playerid][WEAPON10],sPlayerInfo[playerid][WEAPON10AMMO]);
	    GivePlayerWeapon(playerid,sPlayerInfo[playerid][WEAPON11],sPlayerInfo[playerid][WEAPON11AMMO]);
	    GivePlayerWeapon(playerid,sPlayerInfo[playerid][WEAPON12],sPlayerInfo[playerid][WEAPON12AMMO]);
	    ResetPlayerMoney(playerid);
	    GivePlayerMoney(playerid,sPlayerInfo[playerid][MONEY]);
	}
	return 1;
}
//------------------------------------------------------------------------------
public OnPlayerDeath(playerid, killerid, reason)
{
	GameTextForPlayer(playerid, "~r~Wasted", 1000, 2);
	sPlayerInfo[playerid][SPAWNED] = false;
	SendDeathMessage(killerid,playerid,reason);
	sPlayerInfo[playerid][DEATHS] ++;
	sPlayerInfo[killerid][KILLS] ++;
	sPlayerInfo[playerid][HEALTH] = 0;
	sPlayerInfo[playerid][ARMOUR] = 0;
	sPlayerInfo[playerid][POSX] = 0;
	sPlayerInfo[playerid][POSY] = 0;
	sPlayerInfo[playerid][POSZ] = 0;
	sPlayerInfo[playerid][INTERIOR] = 0;
	sPlayerInfo[playerid][ANGLE] = 0;
	return 1;
}
//------------------------------------------------------------------------------
public OnGameModeInit()
{
	SetGameModeText("OWN3D RP W.I.P");
	ShowNameTags(1);
	SetNameTagDrawDistance(20.0);
	LimitGlobalChatRadius(0.0);
	ShowPlayerMarkers(1);
	DisableInteriorEnterExits();
	AllowInteriorWeapons(1);
 	EnableStuntBonusForAll(0);
 	SetWorldTime(10);
 	//Classes
	AddPlayerClassEx(0,105,0,0,20,0,-1,-1,-1,-1,-1,-1);
	AddPlayerClassEx(1,105,0,0,20,0,-1,-1,-1,-1,-1,-1);
	//Pickups
	pickup[POLICESTATION] = CreatePickup(1247,3,1554.738,-1675.6193,15.1703,200); //LSPD
	return 1;
}
//------------------------------------------------------------------------------
public OnPlayerPickUpPickup(playerid, pickupid)
{
	if(pickupid == pickup[POLICESTATION]) {
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"Los Santos Police Department. /enter to go inside.");
		DestroyPickup(pickup[POLICESTATION]);
		SetTimer("PDRespawn",5000,false);
	}
	return 1;
}
//------------------------------------------------------------------------------
public PDRespawn()
{
	DestroyPickup(pickup[POLICESTATION]);
	pickup[POLICESTATION] = CreatePickup(1247,3,1554.738,-1675.6193,15.1703,200);
	return 1;
}
//------------------------------------------------------------------------------
public StatsUpdate(playerid)
{
	if(!sPlayerInfo[playerid][AUTHED]) return 1;
	if(IsPlayerAdmin(playerid)) sPlayerInfo[playerid][ADMIN] = 2;
	if(sPlayerInfo[playerid][SPAWNED]) {
		GetPlayerPos(playerid,sPlayerInfo2[playerid][POSX],sPlayerInfo2[playerid][POSY],sPlayerInfo2[playerid][POSZ]);
		GetPlayerFacingAngle(playerid,sPlayerInfo2[playerid][ANGLE]);
		GetPlayerHealth(playerid,sPlayerInfo2[playerid][HEALTH]);
		GetPlayerArmour(playerid,sPlayerInfo2[playerid][ARMOUR]);
		sPlayerInfo[playerid][INTERIOR] = GetPlayerInterior(playerid);
		sPlayerInfo[playerid][WEAPON0AMMO] = GetPlayerAmmoInSlot(playerid, 0);
		sPlayerInfo[playerid][WEAPON1AMMO] = GetPlayerAmmoInSlot(playerid, 1);
		sPlayerInfo[playerid][WEAPON2AMMO] = GetPlayerAmmoInSlot(playerid, 2);
		sPlayerInfo[playerid][WEAPON3AMMO] = GetPlayerAmmoInSlot(playerid, 3);
		sPlayerInfo[playerid][WEAPON4AMMO] = GetPlayerAmmoInSlot(playerid, 4);
		sPlayerInfo[playerid][WEAPON5AMMO] = GetPlayerAmmoInSlot(playerid, 5);
		sPlayerInfo[playerid][WEAPON6AMMO] = GetPlayerAmmoInSlot(playerid, 6);
		sPlayerInfo[playerid][WEAPON7AMMO] = GetPlayerAmmoInSlot(playerid, 7);
		sPlayerInfo[playerid][WEAPON8AMMO] = GetPlayerAmmoInSlot(playerid, 8);
		sPlayerInfo[playerid][WEAPON9AMMO] = GetPlayerAmmoInSlot(playerid, 9);
		sPlayerInfo[playerid][WEAPON10AMMO] = GetPlayerAmmoInSlot(playerid, 10);
		sPlayerInfo[playerid][WEAPON11AMMO] = GetPlayerAmmoInSlot(playerid, 11);
		sPlayerInfo[playerid][WEAPON12AMMO] = GetPlayerAmmoInSlot(playerid, 12);
		SaveStats(playerid);
	}
	return 1;
}
//------------------------------------------------------------------------------
public OnPlayerConnect(playerid)
{
	new string[128];
	format(string,sizeof(string), "*** %s (ID: %d) joined the server",PlayerName(playerid),playerid);
	SendClientMessageToAll(COLOR_YELLOW,string);
	format(string,sizeof(string),"~y~OWN~r~3~y~D ~b~Roleplay~n~~p~v W.I.P");
	GameTextForPlayer(playerid,string,5,1);
	SendClientMessage(playerid,COLOR_GREEN,"Welcome to OWN3D Roleplay.");
	SetPlayerColor(playerid,COLOR_GREY);
	ResetStats(playerid);
	sPlayerInfo[playerid][SPAWNED] = false;
	sPlayerInfo[playerid][AUTHED] = false;
	RemovePlayerAttachedObject(playerid, 0);
	statauto[playerid] = SetTimer("StatsUpdate",10000,true);
	format(string, sizeof(string), "\\own3d_roleplay\\stats\\%s.sav", PlayerName(playerid));
	if(!dini_Exists(string)) {
		ShowPlayerDialog(playerid,NEWCOMERS,DIALOG_STYLE_MSGBOX,"Welcome","\tWelcome to OWN3D Roleplay!\n You appear to be new, so let's quickly go through the regestration process.","Next","Close");
		SendClientMessage(playerid,COLOR_YELLOW,"*** Account not found. Please use /register");
	} else if (dini_Exists(string)) {
	    format(string,sizeof(string),"\tWelcome back to OWN3D Roleplay!\n\nAccount:\t%s\n\nPlease enter your password below:",PlayerName(playerid));
		ShowPlayerDialog(playerid,LOGIN,DIALOG_STYLE_INPUT,"Account Login",string,"Login","Cancel");
		SendClientMessage(playerid,COLOR_YELLOW,"*** Account found. Please use /login");
	}
	SetPlayerMapIcon(playerid,30,1554.738,-1675.6193,15.1703,30,0); //LSPD
	return 1;
}
//------------------------------------------------------------------------------
public OnPlayerDisconnect(playerid, reason)
{
	new string[128];
	SaveStats(playerid);
	sPlayerInfo[playerid][SPAWNED] = false;
	sPlayerInfo[playerid][AUTHED] = false;
	KillTimer(statauto[playerid]);
	switch (reason)
   	{
	  	case 0:
	  	{
	  		format(string,sizeof(string), "*** %s (ID: %d) left the server (Timeout)",PlayerName(playerid),playerid);
   			SendClientMessageToAll(COLOR_YELLOW,string);
	  	}
		case 1:
		{
		  	format(string,sizeof(string), "*** %s (ID: %d) left the server (Quitting)",PlayerName(playerid),playerid);
   			SendClientMessageToAll(COLOR_YELLOW,string);
		}
		case 2:
		{
			format(string,sizeof(string), "*** %s (ID: %d) left the server (Kick/Ban)",PlayerName(playerid),playerid);
   			SendClientMessageToAll(COLOR_YELLOW,string);
		}
	}
	return 1;
}
//------------------------------------------------------------------------------
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	new string[128];
	if(dialogid == NEWCOMERS) {
		format(string,sizeof(string),"\tWelcome to OWN3D Roleplay!\n\nRegistering this account:\t%s\n\nPlease enter your password below:",PlayerName(playerid));
		ShowPlayerDialog(playerid,REGISTER,DIALOG_STYLE_INPUT,"Account Registration",string,"Register","Cancel");
		return 1;
	}
	if(dialogid == REGISTER) {
		if(response) {
			format(string, sizeof(string), "\\own3d_roleplay\\stats\\%s.sav", PlayerName(playerid));
			if(!strlen(inputtext)) return SendClientMessage(playerid,0xFFFFFFFF,"Regestration error. You must enter a password.");
	    	dini_IntSet(string,"password",hashstring(inputtext));
			SendClientMessage(playerid,COLOR_YELLOW,"*** Account Created. Welcome!");
			sPlayerInfo[playerid][AUTHED] = true;
			SaveStats(playerid);
		}
		return 1;
	}
	if(dialogid == LOGIN) {
		if(response) {
			format(string, sizeof(string), "\\own3d_roleplay\\stats\\%s.sav", PlayerName(playerid));
			if(hashstring(inputtext) != dini_Int(string,"password")) {
				SendClientMessage(playerid, COLOR_RED, "ERROR: Incorrect Password.");
			} else {
				LoadStats(playerid);
				SendClientMessage(playerid,COLOR_YELLOW,"*** Logged in. Welcome Back!");
				sPlayerInfo[playerid][AUTHED] = true;
			}
		}
		return 1;
	}
	return 0;
}
//------------------------------------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
{
	new cmd[256], string[128], idx;
	cmd = strtok(cmdtext, idx);
	if(!strcmp(cmd, "/cmds", true)) {
		SendClientMessage(playerid, COLOR_YELLOW,"------------------------------------------------");
		SendClientMessage(playerid, COLOR_GREEN,"");
		SendClientMessage(playerid, COLOR_YELLOW,"------------------------------------------------");
		return 1;
	}
	if(!strcmp(cmd, "/enter", true)) {
		if(IsPlayerInRangeOfPoint(playerid,5,1554.738,-1675.6193,15.1703)) {
		    SetPlayerInterior(playerid,6);
		    SetPlayerPos(playerid,246.7764,63.0232,1002.6406);
		    SetPlayerFacingAngle(playerid,180.0);
		    SetCameraBehindPlayer(playerid);
		    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Welcome to LSPD. To exit, go to the door and type /exit.");
		} else return SendClientMessage(playerid, COLOR_ORANGE, "*** Too far away from any enterance.");
	}
	if(!strcmp(cmd, "/exit", true)) {
		if(IsPlayerInRangeOfPoint(playerid,5,246.7764,63.0232,1002.6406)) {
		    SetPlayerInterior(playerid,0);
		    SetPlayerPos(playerid,1554.738,-1675.6193,15.1703);
		    SetPlayerFacingAngle(playerid,90.0);
		    SetCameraBehindPlayer(playerid);
		} else return SendClientMessage(playerid, COLOR_ORANGE, "*** Too far away from any exit.");
		return 1;
	}
	if(!strcmp(cmd, "/login", true)) {
		format(string, sizeof(string), "\\own3d_roleplay\\stats\\%s.sav", PlayerName(playerid));
	    if(!dini_Exists(string)) return SendClientMessage(playerid, COLOR_YELLOW, "*** Account does not exist. Use /register first");
	    format(string,sizeof(string),"\tWelcome back to OWN3D Roleplay!\n\nAccount:\t%s\n\nPlease enter your password below:",PlayerName(playerid));
		ShowPlayerDialog(playerid,LOGIN,DIALOG_STYLE_INPUT,"Account Login",string,"Login","Cancel");
		return 1;
	}
	if(!strcmp(cmd, "/register", true)) {
		format(string, sizeof(string), "\\own3d_roleplay\\stats\\%s.sav", PlayerName(playerid));
	    if(dini_Exists(string)) return SendClientMessage(playerid, COLOR_YELLOW, "*** Account already exists. Use /login");
		format(string,sizeof(string),"\tWelcome to OWN3D Roleplay!\n\nRegistering this account:\t%s\n\nPlease enter your password below:",PlayerName(playerid));
		ShowPlayerDialog(playerid,REGISTER,DIALOG_STYLE_INPUT,"Account Registration",string,"Register","Cancel");
		return 1;
	}
	return SendClientMessage(playerid, COLOR_RED,"ERROR: Invalid Command. Type /cmds for a list of all commands.");
}
//------------------------------------------------------------------------------
public SaveStats(playerid)
{
	new string[128];
	format(string, sizeof(string), "\\own3d_roleplay\\stats\\%s.sav", PlayerName(playerid));
	if(!dini_Exists(string)) dini_Create(string);
	dini_IntSet(string,"skin",sPlayerInfo[playerid][SKIN]);
	dini_IntSet(string,"money",sPlayerInfo[playerid][MONEY]);
	dini_IntSet(string,"bankmoney",sPlayerInfo[playerid][BANKMONEY]);
	dini_IntSet(string,"kills",sPlayerInfo[playerid][KILLS]);
	dini_IntSet(string,"deaths",sPlayerInfo[playerid][DEATHS]);
	dini_IntSet(string,"timeskicked",sPlayerInfo[playerid][KICKED]);
	dini_FloatSet(string,"lastposx",sPlayerInfo2[playerid][POSX]);
	dini_FloatSet(string,"lastposy",sPlayerInfo2[playerid][POSY]);
	dini_FloatSet(string,"lastposz",sPlayerInfo2[playerid][POSZ]);
	dini_FloatSet(string,"lastangle",sPlayerInfo2[playerid][ANGLE]);
	dini_IntSet(string,"lastinterior",sPlayerInfo[playerid][INTERIOR]);
	dini_FloatSet(string,"lasthealth",sPlayerInfo2[playerid][HEALTH]);
	dini_FloatSet(string,"lastarmour",sPlayerInfo2[playerid][ARMOUR]);
	dini_IntSet(string,"weapon0",sPlayerInfo[playerid][WEAPON0]);
	dini_IntSet(string,"weapon0ammo",sPlayerInfo[playerid][WEAPON0AMMO]);
	dini_IntSet(string,"weapon1",sPlayerInfo[playerid][WEAPON1]);
	dini_IntSet(string,"weapon1ammo",sPlayerInfo[playerid][WEAPON1AMMO]);
	dini_IntSet(string,"weapon2",sPlayerInfo[playerid][WEAPON2]);
	dini_IntSet(string,"weapon2ammo",sPlayerInfo[playerid][WEAPON2AMMO]);
	dini_IntSet(string,"weapon3",sPlayerInfo[playerid][WEAPON3]);
	dini_IntSet(string,"weapon3ammo",sPlayerInfo[playerid][WEAPON3AMMO]);
	dini_IntSet(string,"weapon4",sPlayerInfo[playerid][WEAPON4]);
	dini_IntSet(string,"weapon4ammo",sPlayerInfo[playerid][WEAPON4AMMO]);
	dini_IntSet(string,"weapon5",sPlayerInfo[playerid][WEAPON5]);
	dini_IntSet(string,"weapon5ammo",sPlayerInfo[playerid][WEAPON5AMMO]);
	dini_IntSet(string,"weapon6",sPlayerInfo[playerid][WEAPON6]);
	dini_IntSet(string,"weapon6ammo",sPlayerInfo[playerid][WEAPON6AMMO]);
	dini_IntSet(string,"weapon7",sPlayerInfo[playerid][WEAPON7]);
	dini_IntSet(string,"weapon7ammo",sPlayerInfo[playerid][WEAPON7AMMO]);
	dini_IntSet(string,"weapon8",sPlayerInfo[playerid][WEAPON8]);
	dini_IntSet(string,"weapon8ammo",sPlayerInfo[playerid][WEAPON8AMMO]);
	dini_IntSet(string,"weapon9",sPlayerInfo[playerid][WEAPON9]);
	dini_IntSet(string,"weapon9ammo",sPlayerInfo[playerid][WEAPON9AMMO]);
	dini_IntSet(string,"weapon10",sPlayerInfo[playerid][WEAPON10]);
	dini_IntSet(string,"weapon10ammo",sPlayerInfo[playerid][WEAPON10AMMO]);
	dini_IntSet(string,"weapon11",sPlayerInfo[playerid][WEAPON11]);
	dini_IntSet(string,"weapon11ammo",sPlayerInfo[playerid][WEAPON11AMMO]);
	dini_IntSet(string,"weapon12",sPlayerInfo[playerid][WEAPON12]);
	dini_IntSet(string,"weapon12ammo",sPlayerInfo[playerid][WEAPON12AMMO]);
	dini_IntSet(string,"phonenumber",sPlayerInfo[playerid][PHONENUMBER]);
	dini_IntSet(string,"drugs",sPlayerInfo[playerid][DRUGS]);
	dini_IntSet(string,"job",sPlayerInfo[playerid][JOB]);
	dini_IntSet(string,"jailed",sPlayerInfo[playerid][JAILED]);
	dini_IntSet(string,"materials",sPlayerInfo[playerid][MATERIALS]);
	dini_IntSet(string,"drugseeds",sPlayerInfo[playerid][DRUGSEEDS]);
	dini_IntSet(string,"passport",sPlayerInfo[playerid][PASSPORT]);
	dini_IntSet(string,"driverlicense",sPlayerInfo[playerid][DRIVERLICENSE]);
	dini_IntSet(string,"boatlicense",sPlayerInfo[playerid][BOATLICENSE]);
	dini_IntSet(string,"trucklicense",sPlayerInfo[playerid][TRUCKLICENSE]);
	dini_IntSet(string,"fishinglicense",sPlayerInfo[playerid][FISHINGLICENSE]);
	dini_IntSet(string,"weaponlicense",sPlayerInfo[playerid][WEAPONLICENSE]);
	dini_IntSet(string,"electricalqualification",sPlayerInfo[playerid][ELECTRICALQUALIFICATION]);
	dini_IntSet(string,"mechanicalqualification",sPlayerInfo[playerid][MECHANICQUALIFICATION]);
	dini_IntSet(string,"lawqualification",sPlayerInfo[playerid][LAWQUALIFICATION]);
	dini_IntSet(string,"medicinequalification",sPlayerInfo[playerid][MEDICINEQUALIFICATION]);
	dini_IntSet(string,"realestatequalification",sPlayerInfo[playerid][REALESTATEQUALIFICATION]);
	dini_IntSet(string,"securityqualification",sPlayerInfo[playerid][SECURITYQUALIFICATION]);
	dini_IntSet(string,"car",sPlayerInfo[playerid][CAR]);
	dini_IntSet(string,"carcol1",sPlayerInfo[playerid][CARCOL1]);
	dini_IntSet(string,"carcol2",sPlayerInfo[playerid][CARCOL2]);
	dini_IntSet(string,"carfuel",sPlayerInfo[playerid][CARFUEL]);
	dini_IntSet(string,"carspoiler",sPlayerInfo[playerid][CARSPOILER]);
	dini_IntSet(string,"carhood",sPlayerInfo[playerid][CARHOOD]);
	dini_IntSet(string,"carroof",sPlayerInfo[playerid][CARROOF]);
	dini_IntSet(string,"carsideskirt",sPlayerInfo[playerid][CARSIDESKIRT]);
	dini_IntSet(string,"carlamps",sPlayerInfo[playerid][CARLAMPS]);
	dini_IntSet(string,"carnitro",sPlayerInfo[playerid][CARNITRO]);
	dini_IntSet(string,"carexhaust",sPlayerInfo[playerid][CAREXHAUST]);
	dini_IntSet(string,"carwheels",sPlayerInfo[playerid][CARWHEELS]);
	dini_IntSet(string,"carstereo",sPlayerInfo[playerid][CARSTEREO]);
	dini_IntSet(string,"carhydraulics",sPlayerInfo[playerid][CARHYDRAULICS]);
	dini_IntSet(string,"carfrontbumper",sPlayerInfo[playerid][CARFRONTBUMPER]);
	dini_IntSet(string,"carrearbumper",sPlayerInfo[playerid][CARREARBUMPER]);
	dini_IntSet(string,"carventleft",sPlayerInfo[playerid][CARVENTLEFT]);
	dini_IntSet(string,"carventright",sPlayerInfo[playerid][CARVENTRIGHT]);
	dini_IntSet(string,"admin",sPlayerInfo[playerid][ADMIN]);
	dini_Set(string,"carnumberplate",sPlayerInfo[playerid][CARPLATE]);
	dini_Set(string,"carhealth",sPlayerInfo[playerid][CARHEALTH]);
	dini_Set(string,"carpanels",sPlayerInfo[playerid][CARPANELS]);
	dini_Set(string,"cardoors",sPlayerInfo[playerid][CARDOORS]);
	dini_Set(string,"carlights",sPlayerInfo[playerid][CARLIGHTS]);
	dini_Set(string,"cartires",sPlayerInfo[playerid][CARTIRES]);
	return 1;
}
//------------------------------------------------------------------------------
public LoadStats(playerid)
{
	new string[128];
	format(string, sizeof(string), "\\own3d_roleplay\\stats\\%s.sav", PlayerName(playerid));
	sPlayerInfo[playerid][SKIN] = dini_Int(string,"skin");
	sPlayerInfo[playerid][MONEY] = dini_Int(string,"money");
	sPlayerInfo[playerid][BANKMONEY] = dini_Int(string,"bankmoney");
	sPlayerInfo[playerid][KILLS] = dini_Int(string,"kills");
	sPlayerInfo[playerid][DEATHS] = dini_Int(string,"deaths");
	sPlayerInfo[playerid][KICKED] = dini_Int(string,"timeskicked");
	sPlayerInfo2[playerid][POSX] = dini_Float(string,"lastposx");
	sPlayerInfo2[playerid][POSY] = dini_Float(string,"lastposy");
	sPlayerInfo2[playerid][POSZ] = dini_Float(string,"lastposz");
	sPlayerInfo2[playerid][ANGLE] = dini_Float(string,"lastangle");
	sPlayerInfo[playerid][INTERIOR] = dini_Int(string,"lastinterior");
	sPlayerInfo2[playerid][HEALTH] = dini_Float(string,"lasthealth");
	sPlayerInfo2[playerid][ARMOUR] = dini_Float(string,"lastarmour");
	sPlayerInfo[playerid][WEAPON0] = dini_Int(string,"weapon0");
	sPlayerInfo[playerid][WEAPON0AMMO] = dini_Int(string,"weapon0ammo");
	sPlayerInfo[playerid][WEAPON1] = dini_Int(string,"weapon1");
	sPlayerInfo[playerid][WEAPON1AMMO] = dini_Int(string,"weapon1ammo");
	sPlayerInfo[playerid][WEAPON2] = dini_Int(string,"weapon2");
	sPlayerInfo[playerid][WEAPON2AMMO] = dini_Int(string,"weapon2ammo");
	sPlayerInfo[playerid][WEAPON3] = dini_Int(string,"weapon3");
	sPlayerInfo[playerid][WEAPON3AMMO] = dini_Int(string,"weapon3ammo");
	sPlayerInfo[playerid][WEAPON4] = dini_Int(string,"weapon4");
	sPlayerInfo[playerid][WEAPON4AMMO] = dini_Int(string,"weapon4ammo");
	sPlayerInfo[playerid][WEAPON5] = dini_Int(string,"weapon5");
	sPlayerInfo[playerid][WEAPON5AMMO] = dini_Int(string,"weapon5ammo");
	sPlayerInfo[playerid][WEAPON6] = dini_Int(string,"weapon6");
	sPlayerInfo[playerid][WEAPON6AMMO] = dini_Int(string,"weapon6ammo");
	sPlayerInfo[playerid][WEAPON7] = dini_Int(string,"weapon7");
	sPlayerInfo[playerid][WEAPON7AMMO] = dini_Int(string,"weapon7ammo");
	sPlayerInfo[playerid][WEAPON8] = dini_Int(string,"weapon8");
	sPlayerInfo[playerid][WEAPON8AMMO] = dini_Int(string,"weapon8ammo");
	sPlayerInfo[playerid][WEAPON9] = dini_Int(string,"weapon9");
	sPlayerInfo[playerid][WEAPON9AMMO] = dini_Int(string,"weapon9ammo");
	sPlayerInfo[playerid][WEAPON10] = dini_Int(string,"weapon10");
	sPlayerInfo[playerid][WEAPON10AMMO] = dini_Int(string,"weapon10ammo");
	sPlayerInfo[playerid][WEAPON11] = dini_Int(string,"weapon11");
	sPlayerInfo[playerid][WEAPON11AMMO] = dini_Int(string,"weapon11ammo");
	sPlayerInfo[playerid][WEAPON12] = dini_Int(string,"weapon12");
	sPlayerInfo[playerid][WEAPON12AMMO] = dini_Int(string,"weapon12ammo");
	sPlayerInfo[playerid][PHONENUMBER] = dini_Int(string,"phonenumber");
	sPlayerInfo[playerid][DRUGS] = dini_Int(string,"drugs");
	sPlayerInfo[playerid][JOB] = dini_Int(string,"job");
	sPlayerInfo[playerid][JAILED] = dini_Int(string,"jailed");
	sPlayerInfo[playerid][MATERIALS] = dini_Int(string,"materials");
	sPlayerInfo[playerid][DRUGSEEDS] = dini_Int(string,"drugseeds");
	sPlayerInfo[playerid][PASSPORT] = dini_Int(string,"passport");
	sPlayerInfo[playerid][DRIVERLICENSE] = dini_Int(string,"driverlicense");
	sPlayerInfo[playerid][BOATLICENSE] = dini_Int(string,"boatlicense");
	sPlayerInfo[playerid][TRUCKLICENSE] = dini_Int(string,"trucklicense");
	sPlayerInfo[playerid][FISHINGLICENSE] = dini_Int(string,"fishinglicense");
	sPlayerInfo[playerid][WEAPONLICENSE] = dini_Int(string,"weaponlicense");
	sPlayerInfo[playerid][ELECTRICALQUALIFICATION] = dini_Int(string,"electricalqualification");
	sPlayerInfo[playerid][MECHANICQUALIFICATION] = dini_Int(string,"mechanicalqualification");
	sPlayerInfo[playerid][LAWQUALIFICATION] = dini_Int(string,"lawqualification");
	sPlayerInfo[playerid][MEDICINEQUALIFICATION] = dini_Int(string,"medicinequalification");
	sPlayerInfo[playerid][REALESTATEQUALIFICATION] = dini_Int(string,"realestatequalification");
	sPlayerInfo[playerid][SECURITYQUALIFICATION] = dini_Int(string,"securityqualification");
	sPlayerInfo[playerid][CAR] = dini_Int(string,"car");
	sPlayerInfo[playerid][CARCOL1] = dini_Int(string,"carcol1");
	sPlayerInfo[playerid][CARCOL2] = dini_Int(string,"carcol2");
	sPlayerInfo[playerid][CARFUEL] = dini_Int(string,"carfuel");
	sPlayerInfo[playerid][CARSPOILER] = dini_Int(string,"carspoiler");
	sPlayerInfo[playerid][CARHOOD] = dini_Int(string,"carhood");
	sPlayerInfo[playerid][CARROOF] = dini_Int(string,"carroof");
	sPlayerInfo[playerid][CARSIDESKIRT] = dini_Int(string,"carsideskirt");
	sPlayerInfo[playerid][CARLAMPS] = dini_Int(string,"carlamps");
	sPlayerInfo[playerid][CARNITRO] = dini_Int(string,"carnitro");
	sPlayerInfo[playerid][CAREXHAUST] = dini_Int(string,"carexhaust");
	sPlayerInfo[playerid][CARWHEELS] = dini_Int(string,"carwheels");
	sPlayerInfo[playerid][CARSTEREO] = dini_Int(string,"carstereo");
	sPlayerInfo[playerid][CARHYDRAULICS] = dini_Int(string,"carhydraulics");
	sPlayerInfo[playerid][CARFRONTBUMPER] = dini_Int(string,"carfrontbumper");
	sPlayerInfo[playerid][CARREARBUMPER] = dini_Int(string,"carrearbumper");
	sPlayerInfo[playerid][CARVENTLEFT] = dini_Int(string,"carventleft");
	sPlayerInfo[playerid][CARVENTRIGHT] = dini_Int(string,"carventright");
	sPlayerInfo[playerid][ADMIN] = dini_Int(string,"admin");
	sPlayerCar[playerid][CARPLATE] = dini_Get(string,"carnumberplate");
	sPlayerCar[playerid][CARHEALTH] = dini_Get(string,"carhealth");
	sPlayerCar[playerid][CARPANELS] = dini_Get(string,"carpanels");
	sPlayerCar[playerid][CARDOORS] = dini_Get(string,"cardoors");
	sPlayerCar[playerid][CARLIGHTS] = dini_Get(string,"carlights");
	sPlayerCar[playerid][CARTIRES] = dini_Get(string,"cartires");
	return 1;
}
//------------------------------------------------------------------------------
public ResetStats(playerid)
{
	sPlayerInfo[playerid][SKIN] = -1;
	sPlayerInfo[playerid][MONEY] = 0;
	sPlayerInfo[playerid][BANKMONEY] = 0;
	sPlayerInfo[playerid][KILLS] = 0;
	sPlayerInfo[playerid][DEATHS] = 0;
	sPlayerInfo[playerid][KICKED] = 0;
	sPlayerInfo2[playerid][POSX] = 0;
	sPlayerInfo2[playerid][POSY] = 0;
	sPlayerInfo2[playerid][POSZ] = 0;
	sPlayerInfo2[playerid][ANGLE] = 0;
	sPlayerInfo[playerid][INTERIOR] = 0;
	sPlayerInfo2[playerid][HEALTH] = 0;
	sPlayerInfo2[playerid][ARMOUR] = 0;
	sPlayerInfo[playerid][WEAPON0] = 0;
	sPlayerInfo[playerid][WEAPON0AMMO] = 0;
	sPlayerInfo[playerid][WEAPON1] = 0;
	sPlayerInfo[playerid][WEAPON1AMMO] = 0;
	sPlayerInfo[playerid][WEAPON2] = 0;
	sPlayerInfo[playerid][WEAPON2AMMO] = 0;
	sPlayerInfo[playerid][WEAPON3] = 0;
	sPlayerInfo[playerid][WEAPON3AMMO] = 0;
	sPlayerInfo[playerid][WEAPON4] = 0;
	sPlayerInfo[playerid][WEAPON4AMMO] = 0;
	sPlayerInfo[playerid][WEAPON5] = 0;
	sPlayerInfo[playerid][WEAPON5AMMO] = 0;
	sPlayerInfo[playerid][WEAPON6] = 0;
	sPlayerInfo[playerid][WEAPON6AMMO] = 0;
	sPlayerInfo[playerid][WEAPON7] = 0;
	sPlayerInfo[playerid][WEAPON7AMMO] = 0;
	sPlayerInfo[playerid][WEAPON8] = 0;
	sPlayerInfo[playerid][WEAPON8AMMO] = 0;
	sPlayerInfo[playerid][WEAPON9] = 0;
	sPlayerInfo[playerid][WEAPON9AMMO] = 0;
	sPlayerInfo[playerid][WEAPON10] = 0;
	sPlayerInfo[playerid][WEAPON10AMMO] = 0;
	sPlayerInfo[playerid][WEAPON11] = 0;
	sPlayerInfo[playerid][WEAPON11AMMO] = 0;
	sPlayerInfo[playerid][WEAPON12] = 0;
	sPlayerInfo[playerid][WEAPON12AMMO] = 0;
	sPlayerInfo[playerid][PHONENUMBER] = 0;
	sPlayerInfo[playerid][DRUGS] = 0;
	sPlayerInfo[playerid][JOB] = 0;
	sPlayerInfo[playerid][JAILED] = 0;
	sPlayerInfo[playerid][MATERIALS] = 0;
	sPlayerInfo[playerid][DRUGSEEDS] = 0;
	sPlayerInfo[playerid][PASSPORT] = 0;
	sPlayerInfo[playerid][DRIVERLICENSE] = 0;
	sPlayerInfo[playerid][BOATLICENSE] = 0;
	sPlayerInfo[playerid][TRUCKLICENSE] = 0;
	sPlayerInfo[playerid][FISHINGLICENSE] = 0;
	sPlayerInfo[playerid][WEAPONLICENSE] = 0;
	sPlayerInfo[playerid][ELECTRICALQUALIFICATION] = 0;
	sPlayerInfo[playerid][MECHANICQUALIFICATION] = 0;
	sPlayerInfo[playerid][LAWQUALIFICATION] = 0;
	sPlayerInfo[playerid][MEDICINEQUALIFICATION] = 0;
	sPlayerInfo[playerid][REALESTATEQUALIFICATION] = 0;
	sPlayerInfo[playerid][SECURITYQUALIFICATION] = 0;
	sPlayerInfo[playerid][CAR] = 0;
	sPlayerInfo[playerid][CARCOL1] = 0;
	sPlayerInfo[playerid][CARCOL2] = 0;
	sPlayerInfo[playerid][CARFUEL] = 0;
	sPlayerInfo[playerid][CARSPOILER] = 0;
	sPlayerInfo[playerid][CARHOOD] = 0;
	sPlayerInfo[playerid][CARROOF] = 0;
	sPlayerInfo[playerid][CARSIDESKIRT] = 0;
	sPlayerInfo[playerid][CARLAMPS] = 0;
	sPlayerInfo[playerid][CARNITRO] = 0;
	sPlayerInfo[playerid][CAREXHAUST] = 0;
	sPlayerInfo[playerid][CARWHEELS] = 0;
	sPlayerInfo[playerid][CARSTEREO] = 0;
	sPlayerInfo[playerid][CARHYDRAULICS] = 0;
	sPlayerInfo[playerid][CARFRONTBUMPER] = 0;
	sPlayerInfo[playerid][CARREARBUMPER] = 0;
	sPlayerInfo[playerid][CARVENTLEFT] = 0;
	sPlayerInfo[playerid][CARVENTRIGHT] = 0;
	sPlayerInfo[playerid][ADMIN] = 0;
	sPlayerInfo[playerid][TASER] = false;
	sPlayerInfo[playerid][CHOPSHOP] = false;
	sPlayerCar[playerid][CARPLATE] = "";
	sPlayerCar[playerid][CARHEALTH] = "";
	sPlayerCar[playerid][CARPANELS] = "";
	sPlayerCar[playerid][CARDOORS] = "";
	sPlayerCar[playerid][CARLIGHTS] = "";
	sPlayerCar[playerid][CARTIRES] = "";
	return 1;
}
//------------------------------------------------------------------------------
stock PlayerName(playerid)
{
	new playername[32];
	GetPlayerName(playerid, playername, sizeof(playername));
	return playername;
}
//------------------------------------------------------------------------------
stock hashstring(string[]) {
	new a, b;
    for (new c=0; c<strlen(string); c++)
    {
       a = (a + string[c]) % 65521;
       b = (b + a) % 65521;
    }
    return (b<<16)+a;
}
//------------------------------------------------------------------------------
stock GetPlayerAmmoInSlot(playerid, slot)
{
	new getweapon[MAX_PLAYERS], getammo[MAX_PLAYERS];
	GetPlayerWeaponData(playerid, slot, getweapon[playerid], getammo[playerid]);
	return getammo[playerid];
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)