Arrgghh I Can't update the inis through a filterscript
#1

Okay so this is what I have
Код:
stock AddSpeedingCam(playerid, Float:xx, Float:yy, Float:zz, radius, speed)
{
	new fine[MAX_PLAYERS];
 	new str[256];

 	if(objectcreated!=MaxObjects)
  	{
    	CreateObject(playerid, xx, yy, zz, 0.0, 0.0, 10);
     	objectcreated++;
  	}
  	if((distance1[playerid])>speed)
  	{
		if(IsPlayerInCircle(playerid, xx, yy, radius)  && GetPlayerState(playerid)== PLAYER_STATE_DRIVER)
		{
		    new plname[MAX_PLAYER_NAME];
		    new string[64];
			fine[playerid]=((distance1[playerid]*17/10)-speed);
			GivePlayerMoney(playerid, -fine[playerid]);
   			format(string, sizeof(string),"LARP/Users/%s.ini",plname);
    		dini_IntSet(string,"Money",-fine[playerid]);
            SendClientMessage(playerid, COLOR_PURPLE, "You bypassed the Police Automatic Speeding camera too fast and its light flashed for you.");
			format(str,sizeof(str), "[SPEED CAM] You were driving faster than %d MP/H (Your speed was %d MP/H) and got fined for $%d",speed, distance1[playerid] ,fine[playerid]);
            GameTextForPlayer(playerid, "~r~AUTOMATIC SPEEDING CAMERA!", 5000, 3);
            PlayerPlaySound(playerid, 1132, 0.0, 0.0, 0.0);
			SendClientMessage(playerid, COLOR_YELLOW, str);
		}
	}
}
this is just some of it...

Yes I am using Raven's Script I try to update the money area in the ini file with no luck.... it gets taken out of my ingame money but does not get updated in ini file and when I use /fixmoney it just gets added on... I've been working on this pretty much all day with no luck....

Well thanks for the help ahead of time!!!!
Reply
#2

Ask in the original authors thread, thats your best bet.
Reply
#3

Well isn't there a way by using dini I could just update it
Reply
#4

I don't see the reason you would be setting information to the player's file every time it changes in the script. Especially something that is held by the server, like money. And especially when you are using a file system like dini.

You should only save the information to the file once; when the player disconnects to the server - OnPlayerDisconnect. Unless you have a specific reason for doing otherwise, you shouldn't, it's just unnecessary.
Reply
#5

EDIT FIXED HARDCODED INTO THE SCRIPT! Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)