SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Discussion

Reply
 
Thread Tools Display Modes
Old 13/12/2017, 06:43 PM   #1
SaNeLSANY
Little Clucker
 
Join Date: Nov 2013
Posts: 16
Reputation: 2
Default Offline loading data y_ini

So, I'm making a command that will load user activity while he is offline.
The problem is that it always shows 0...
Here is the code:

Code:
CMD:aktivnostigraca(playerid, params[])
{
	new ime[40];
	new string[264], string2[264];
	if(PlayerInfo[playerid][pAdmin] < 1337) return SCM(playerid, COLOR_GREY, "[GRESKA] Samo Admini!");
	if(sscanf(params, "s[40]", ime)) return SCM(playerid, COLOR_GREY, "[Komanda] /aktivnositgraca [IME_PREZIME]");
	new id = GetPlayerID(ime);
	if(!IsPlayerConnected(id))
	{
	    format(string,sizeof(string),KORISNICI,ime);
		INI_ParseFile(string, "LoadAkt_%s", .bExtra = true, .extra = playerid);
		format(string, 264, "| [OFFLINE] Igrac: %s | Admin Aktivnost: %d | GS Aktivnost: %d | Lider Aktivnost: %d |", ime, AdmAkti, GSAkti, LAkti);
		SCM(playerid, COLOR_GREY, string);
		AdmAkti = 0; GSAkti = 0; LAkti = 0;
	}
	else
	{
		format(string, 264, "| [ONLINE] Igrac: %s | Admin Aktivnost: %d | GS Aktivnost: %d | Lider Aktivnost: %d |", ime, PlayerInfo[id][AdmAkt], PlayerInfo[id][GSAkt], PlayerInfo[playerid][LAkt]);
		SCM(playerid, COLOR_GREY, string);
	}
    return true;
}

forward LoadAkt_data(name[],value[]);
public LoadAkt_data(name[],value[])
{
INI_Int("AdmAktivnost", AdmAkti);
INI_Int("GSAktivnost", GSAkti);
INI_Int("LAktivnost", LAkti);
return 1;
}
for online, it loads ok, it saves when player loggs out and loads when he get ig..
__________________
My GameModes :
My Maps :
Code:
House
A base
Bar
My FilterScripts :
Code:
//
SaNeLSANY is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loading offline player Data (MySQL System) Juvanii Scripting Help 3 30/07/2016 01:34 PM
y_ini loops a lot of times while loading data Muted Scripting Help 0 11/06/2015 12:56 PM
Problem loading object data with y_ini iOxide Scripting Help 6 12/09/2014 07:21 AM
Loading & saving Objects data problem with Y_ini + SetPlayerAttachedObject CharlieSanchez Scripting Help 2 10/06/2014 12:28 PM
Loading data with Y_INI sim_sima Scripting Help 15 15/12/2013 09:53 PM


All times are GMT. The time now is 09:47 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.