Admin filterscript that saves score?
#1

Does anyone know of a admin fs that saves score aswell,
I do not know of any that do,
And dont say dudb or dini or w/e because i havent the slightest clue how to do that,
And i cant learn from tutorials,
Reply
#2

Iґll show you how I did it.

pawn Код:
//-------------THIS GOES AT ONPLAYERCONNECT--------------
    new pn[MAX_PLAYER_NAME], connect[48];
    GetPlayerName(playerid, pn, sizeof(pn));
    format(connect, sizeof(connect), "/userfiles/%s.ini", pn );

    if(dini_Exists(connect))
    {
    SendClientMessage(playerid,YELLOW,"Stats found. Loading..");
    }
    else
    {
  dini_Create(connect);
  SendClientMessage(playerid,YELLOW,"Stats not found. Creating..");
  dini_IntSet(connect, "score", 0);
    }
    new scorez;
    scorez = dini_Int(connect,"score");
    SetPlayerScore(playerid,scorez);
//-----------------------------END OF ONPLAYERCONNECT--------------------------------

//----------------------------THIS GOES AT ONPLAYERDISCONNECT-----------------------

    new pn[MAX_PLAYER_NAME], connect[48];
    GetPlayerName(playerid, pn, sizeof(pn));
    format(connect, sizeof(connect), "/userfiles/%s.ini", pn );
    new scorez;
    scorez = GetPlayerScore(playerid);
    dini_IntSet(connect,"score",scorez);
//-----------------------------END OF ONPLAYERDISCONNECT--------------------------------
Youґll need the dini.inc.
Reply
#3

See i tried following this tutorial:

http://forum.sa-mp.com/index.php?topic=126584.0

I did everything he said, Word for word, Code for code, Ect,
It should compile with no errors,
Does it for me? No!

pawn Код:
C:\Users\Torran\Documents\Server\filterscripts\adminfs.pwn(74) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Torran\Documents\Server\filterscripts\adminfs.pwn(85) : error 017: undefined symbol "eadmin"
C:\Users\Torran\Documents\Server\filterscripts\adminfs.pwn(93) : warning 217: loose indentation
C:\Users\Torran\Documents\Server\filterscripts\adminfs.pwn(69) : warning 204: symbol is assigned a value that is never used: "tmp2"
C:\Users\Torran\Documents\Server\filterscripts\adminfs.pwn(69 -- 100) : error 010: invalid function or declaration
C:\Users\Torran\Documents\Server\filterscripts\adminfs.pwn(103) : error 010: invalid function or declaration
C:\Users\Torran\Documents\Server\filterscripts\adminfs.pwn(104) : error 010: invalid function or declaration
C:\Users\Torran\Documents\Server\filterscripts\adminfs.pwn(106) : error 010: invalid function or declaration
C:\Users\Torran\Documents\Server\filterscripts\adminfs.pwn(109) : error 010: invalid function or declaration
C:\Users\Torran\Documents\Server\filterscripts\adminfs.pwn(111) : error 010: invalid function or declaration
C:\Users\Torran\Documents\Server\filterscripts\adminfs.pwn(115) : error 010: invalid function or declaration
C:\Users\Torran\Documents\Server\filterscripts\adminfs.pwn(118) : error 010: invalid function or declaration
C:\Users\Torran\Documents\Server\filterscripts\adminfs.pwn(124) : error 010: invalid function or declaration
C:\Users\Torran\Documents\Server\filterscripts\adminfs.pwn(127) : error 021: symbol already defined: "SetPlayerMoney"
C:\Users\Torran\Documents\Server\filterscripts\adminfs.pwn(127) : error 010: invalid function or declaration
C:\Users\Torran\Documents\Server\filterscripts\adminfs.pwn(127 -- 133) : error 010: invalid function or declaration
C:\Users\Torran\Documents\Server\filterscripts\adminfs.pwn(127 -- 133) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


14 Errors.
Reply
#4

Oh nvm, Soryr for triple POST :O i didnt realise,
Anyway i only just noticed it was color errors xd.
All gone now :d
Except for
pawn Код:
C:\Users\Torran\Documents\Server\filterscripts\adminfs.pwn(271) : warning 203: symbol is never used: "ret_memcpy"
But that always appears when i use dini or dudb, One of them
Reply
#5

Well easy, just place

Код:
#pragma unused ret_memcpy
at the top of the script.
Reply
#6

#pragma unused ret_memcpy
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)