read - 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: read (
/showthread.php?tid=391391)
read -
AzTeCaS - 10.11.2012
Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
new INI:File = INI_Open("Users/%s.ini",(playerid));
PlayerInfo[playerid][pLevel] = INI_ReadInt("level");
PlayerInfo[playerid][pKills] = INI_ReadInt("kills");
PlayerInfo[playerid][pDeaths] = INI_ReadInt("Deaths");
INI_Close();
new PName[MAX_PLAYER_NAME],strg [190];
GetPlayerName(clickedplayerid, PName, sizeof (PName));
format(strg,sizeof(strg),"{F81414} you are viewing {FFFFFF} %s stats \n {00CED1} Kills : {FFFFFF} %d \n {00CED1} Deaths : {FFFFFF} %d \n {00CED1} Level : {FFFFFF} %d ",PName,pKills,pDeaths,pLevel);
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "{00FF04}Player Stats",strg,"Close","Done");
return 1;
}
Код:
D:\script\gamemodes\DeathMatchADD.pwn(454) : warning 202: number of arguments does not match definition
D:\script\gamemodes\DeathMatchADD.pwn(454) : warning 213: tag mismatch
D:\script\gamemodes\DeathMatchADD.pwn(454) : warning 204: symbol is assigned a value that is never used: "File"
Re: read -
YoYo123 - 10.11.2012
ini_open takes only one parameter which is the directory so remove the 'playerid' parameter you put there.
Re: read -
Mr.Anonymous - 10.11.2012
The Rules & Guidelines of Scripting Help
Rule #5: Use a proper thread title, it should sum up the general problem you're having in a few words. (For example, do not use silly babble like "HELP PLS HELP PLS REP+++", use "Issue with SetPlayerPos and interiors")
For complete set of rules, visit
https://sampforum.blast.hk/showthread.php?tid=355296
Re: read -
Konstantinos - 10.11.2012
You don't need to open and read files again, when it already did it on loading and it stores the data onto the variables. Just use these variables on the format function and it will be ok.
Re: read -
AzTeCaS - 10.11.2012
still giving symbol is assigned a value that is never used: "File" and tagg mistach
Re: read -
Konstantinos - 10.11.2012
As I said, it reads the data from the variables you stored them on ParseFile.
Delete these
pawn Код:
new INI:File = INI_Open("Users/%s.ini",(playerid));
PlayerInfo[playerid][pLevel] = INI_ReadInt("level");
PlayerInfo[playerid][pKills] = INI_ReadInt("kills");
PlayerInfo[playerid][pDeaths] = INI_ReadInt("Deaths");
INI_Close();
And use those variables.