{ new Text:newtext[255], scoretotal, killscore ,deathscore ,ratioscore ,file[128]; format(file,sizeof(file),"/********/Accounts/%s.sav",udb_encode(PlayerName2(playerid))); scoretotal = GetPlayerScore(playerid); killscore = dini_Get(file, "Kills");//error 006: must be assigned to an array deathscore = dini_Get(file, "Deaths");//error 006: must be assigned to an array ratioscore = killscore / deathscore; format(newtext,sizeof(newtext), "~Y~Score: ~W~%d ~R~Deaths: ~W~%d ~P~Kills: ~W~%d ~G~Ratio: ~W~%d",scoretotal, deathscore, killscore ,ratioscore); TextDrawSetString(Textdraw, newtext); TextDrawShowForPlayer(playerid, Textdraw); return 1; }
{
new Text:newtext[255], scoretotal, killscore ,deathscore ,ratioscore ,file[128];
format(file,sizeof(file),"/********/Accounts/%s.sav",udb_encode(PlayerName2(playerid)));
scoretotal = GetPlayerScore(playerid);
killscore = dini_int(file, "Kills");//error 006: must be assigned to an array
deathscore = dini_int(file, "Deaths");//error 006: must be assigned to an array
ratioscore = killscore / deathscore;
format(newtext,sizeof(newtext), "~Y~Score: ~W~%d ~R~Deaths: ~W~%d ~P~Kills: ~W~%d ~G~Ratio: ~W~%d",scoretotal, deathscore, killscore ,ratioscore);
TextDrawSetString(Textdraw, newtext);
TextDrawShowForPlayer(playerid, Textdraw);
return 1;
}
dini_Get returns a string, you need to use dini_IntGet. |
First of all why are you reading Player Info from the ini file? Why not call your Player Variables from your PlayerInfo enum. Most of them look like PlayerInfo[playerid][pKills] or PlayerInfo[playerid][Kills] or similar to this. These are also used to get the value of the array assigned to it! |
//Le script est fait par Jonathan1358. Version 1.4 #include <a_samp> #include <ldudb> #include <lfuncs> new Text:Textdraw; public OnFilterScriptInit() { return 1; } public OnFilterScriptExit() { return 1; } public OnGameModeInit() { Textdraw = TextDrawCreate(350.000000,3.000000,"~Y~Score: ~W~0 ~R~Deaths: ~W~0 ~P~Kills: ~W~0 ~G~TimeScore: ~W~0"); TextDrawAlignment(Textdraw,0); TextDrawBackgroundColor(Textdraw,0x000000ff); TextDrawFont(Textdraw,2); TextDrawLetterSize(Textdraw,0.188888,1.100000); TextDrawColor(Textdraw,0xffffffff); TextDrawSetOutline(Textdraw,1); TextDrawSetProportional(Textdraw,1); TextDrawSetShadow(Textdraw,1); } public OnPlayerSpawn(playerid) { new Text:newtext[255], scoretotal, killscore ,deathscore ,timescore ,file[128]; format(file,sizeof(file),"/*********/Accounts/%s.sav",udb_encode(PlayerName2(playerid))); scoretotal = GetPlayerScore(playerid); killscore = dini_Int(file, "Kills"); deathscore = dini_Int(file, "Deaths"); timescore = dini_Int(file, "Hours");; format(newtext,sizeof(newtext), "~Y~Score: ~W~%d ~R~Deaths: ~W~%d ~P~Kills: ~W~%d ~G~TimeScore: ~W~%d",scoretotal, deathscore, killscore ,timescore); TextDrawSetString(Textdraw, newtext); TextDrawShowForPlayer(playerid, Textdraw); return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/score", cmdtext, true, 10) == 0) { new Text:newtext[255], scoretotal, killscore ,deathscore ,timescore ,file[128]; format(file,sizeof(file),"/********/Accounts/%s.sav",udb_encode(PlayerName2(playerid))); scoretotal = GetPlayerScore(playerid); killscore = dini_Int(file, "Kills"); deathscore = dini_Int(file, "Deaths"); timescore = dini_Int(file, "Hours");; format(newtext,sizeof(newtext), "~Y~Score: ~W~%d ~R~Deaths: ~W~%d ~P~Kills: ~W~%d ~G~TimeScore: ~W~%d",scoretotal, deathscore, killscore ,timescore); TextDrawSetString(Textdraw, newtext); TextDrawShowForPlayer(playerid, Textdraw); GameTextForPlayer(playerid,"~Y~Score Update", 1500, 3); return 1; } return 0; }