07.12.2018, 00:03
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:
I do not know if I explained it well, but if anyone can help me, I'll be very grateful
PHP код:
// Code
new arquivo[70], sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(arquivo, sizeof(arquivo), "Scores/%s.ini", sendername);
if(DOF2_FileExists(arquivo)){
SetPlayerScore(playerid, DOF2_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