SA-MP Forums Archive
stats - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: stats (/showthread.php?tid=504755)



stats - UfsDev - 05.04.2014

Код:
CMD:stats(playerid,params[])
{
	new password = PlayerInfo[playerid][pPass];
	new money = PlayerInfo[playerid][pCash];
	new deaths = PlayerInfo[playerid][pDeaths];
	new kills = PlayerInfo[playerid][pKills];
	new score = PlayerInfo[playerid][pScore];
	new admin = PlayerInfo[playerid][pAdmin];
	new vip = PlayerInfo[playerid][pVIP];
	new killpoints = PlayerInfo[playerid][pKillPoints];
	new string[500];
	format(string,sizeof(string),"Password: %s | Money: %d | Deaths: %d | Kills: %d | Score: %d | Admin: %d | VIP: %d | Killpoints: %d",password,money,deaths,kills,score,admin,vip,killpoints);
	SendClientMessage(playerid,COLOR_WHITE,string);
    return 1;
}
Here Is The Error When Compiling

C:\Users\lol\FR 2013\filterscripts\stats.pwn(1) : warning 203: symbol is never used: "stats"
C:\Users\lol\FR 2013\filterscripts\stats.pwn(1 -- 19) : error 013: no entry point (no public functions)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


Re: stats - Mario' - 05.04.2014

You need to include a_samp and zcmd in the first line


Re: stats - UfsDev - 05.04.2014

dude when i /Q = Quit Samp then join again 0 Scores Why ?


Re: stats - Equuuuin0X - 05.04.2014

pawn Код:
#define PATH "/Users/%s.ini"

stock UserPath(playerid)
    {
        new string[128],playername[MAX_PLAYER_NAME];
        GetPlayerName(playerid,playername,sizeof(playername));
        format(string,sizeof(string),PATH,playername);
        return string;
    }


public OnPlayerDisconnect(playerid, reason)
    {
        new INI:File = INI_Open(UserPath(playerid));
        INI_SetTag(File,"data");
        INI_WriteInt(File,"money",GetPlayerMoney(playerid));
        INI_WriteInt(File,"admin",PlayerInfo[playerid][pAdmin]);
        INI_WriteInt(File,"kills",PlayerInfo[playerid][pKills]);
        INI_WriteInt(File,"deaths",PlayerInfo[playerid][pDeaths]);
        INI_WriteInt(File,"score",PlayerInfo[playerid][pScore]);
            INI_WriteInt(File,"vip",PlayerInfo[playerid][pVIP]);
            INI_WriteInt(File,"killpoints",PlayerInfo[playerid][pKillPoints]);
        INI_Close(File);
        return 1;
    }
Create ''Users'' directory on your scriptfiles folder.


Re: stats - UfsDev - 05.04.2014

what will be the folder name in scriptfiles ?


Re: stats - Equuuuin0X - 05.04.2014

Look at the post again.

Create a file/directory/folder named ''Users'' in scriptfiles.


Re: stats - UfsDev - 05.04.2014

#Equuuuuin0X:
Код:
C:\Users\Khan\FR 2013\filterscripts\stats.pwn(5) : error 017: undefined symbol "MAX_PLAYER_NAME"
C:\Users\Khan\FR 2013\filterscripts\stats.pwn(5) : error 009: invalid array size (negative, zero or out of bounds)
C:\Users\Khan\FR 2013\filterscripts\stats.pwn(5) : error 036: empty statement
C:\Users\Khan\FR 2013\filterscripts\stats.pwn(5) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.



Re: stats - Equuuuin0X - 06.04.2014

Have you added a_samp include ?

#include <a_samp>


Re: stats - superrobot48 - 06.04.2014

did u do
#include <zcmd>



Re: stats - Equuuuin0X - 06.04.2014

Dude, stop with the rudeness, MAX_PLAYERS_NAME is from a_samp include,

so zcmd has nothing to do with it.