SA-MP Forums Archive
[Help] Little question about DOF2 - 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: [Help] Little question about DOF2 (/showthread.php?tid=661511)



[Help] Little question about DOF2 - ApolloScripter - 07.12.2018

Okay, assuming I have the code below to save the server players' score, how do I create a loop that stores each score inside a variable, just like the name, EX:

PHP код:
// Code
    
new arquivo[70], sendername[MAX_PLAYER_NAME];
    
GetPlayerName(playeridsendernamesizeof(sendername));
    
format(arquivosizeof(arquivo), "Scores/%s.ini"sendername);
    if(
DOF2_FileExists(arquivo)){
        
SetPlayerScore(playeridDOF2_GetInt(arquivo"Score"));
    } else{
        
DOF2_CreateFile(arquivo);
        
DOF2_SetInt(arquivo"Score"0);
        
DOF2_SaveFile();
    } 
PHP код:

//stuff here
Then the loop returns me the following
ArrayScore
[1] = 24
ArrayName
[1] = So and so
ArrayScore
[2] = 53
ArrayName
[2] = So and so 
I do not know if I explained it well, but if anyone can help me, I'll be very grateful