Save Score Problem !!
#1

Hi all I have a problem when i do score in my server And then exit it and connect again my score is 0 why ?? Please Helpp
Reply
#2

It doesn't save the score on OnPlayerDisconnect() ?! So make it save
Reply
#3

How sorry but I dont know how
Reply
#4

Show the code of OnPlayerDisconnect()
Reply
#5

Here is my code:

Код:
public OnPlayerDisconnect(playerid, reason)
{
    new
    string[64],
    name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    switch(reason)
    {
        case 0: format(string,sizeof string,"%s left the server. (Timed out)",name);
        case 1: format(string,sizeof string,"%s left the server. (Leaving)",name);
        case 2: format(string,sizeof string,"%s left the server. (Kicked/Banned)",name);
    }
    SendClientMessageToAll(0xFFFFFFAA,string);
    }
	return 1;
}
Reply
#6

You have to save the player stats details on a file or database.
Reply
#7

Quote:
Originally Posted by IvancheBG
Посмотреть сообщение
Here is my code:

Код:
public OnPlayerDisconnect(playerid, reason)
{
    new
    string[64],
    name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    switch(reason)
    {
        case 0: format(string,sizeof string,"%s left the server. (Timed out)",name);
        case 1: format(string,sizeof string,"%s left the server. (Leaving)",name);
        case 2: format(string,sizeof string,"%s left the server. (Kicked/Banned)",name);
    }
    SendClientMessageToAll(0xFFFFFFAA,string);
    }
	return 1;
}
There are many tuts about registering , saving score ; using dini , Y_ini.. Go to Tutorials section.
Reply
#8

Yes, there is nothing to save if the player leaves the server ... and as above ^ search for tuts for saving score etc
Reply
#9

I am with Ladmin and still it dont saves the score when i leave and connect the server : ((
Reply
#10

Ok i tried this http://forum.sa-mp.com/showthread.ph...ght=save+score and still doesnt work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)