Load Player Stats [reps+]
#1

Hello i v textdraw for player which show stats such as kills deaths etc, iv created it in my admin system , but how to load the kills and deaths to be in textdraw:

Код:
public LoginPlayer(playerid, name[], value[])
{
    INI_Int("Level", pInfo[playerid][pLevel]);
    INI_Int("Donator", pInfo[playerid][Donator]);
    INI_Int("Banned", pInfo[playerid][Banned]);
    INI_Int("Kills", pInfo[playerid][Kills]);
    INI_Int("Deaths", pInfo[playerid][Deaths]);
    INI_Int("Muted", pInfo[playerid][Muted]);
    INI_Int("Score", pInfo[playerid][Score]);
    INI_Int("Cash", pInfo[playerid][Cash]);
    INI_Int("Skin", pInfo[playerid][Skin]);
    INI_String("LastLoggedIP", pInfo[playerid][IP], 16);
    INI_Int("TotalSeconds", pInfo[playerid][TotalSecs]);
    return 1;
}
I want it onplayerconnect and save it in TotalKills[playerid] and totaldeaths some thing like that:
Код:
  if(!fexist(Jfile))
    {
	TotalKills[playerid] = INI_Int("Kills", pInfo[playerid][Kills]);
        TotalDeaths[playerid] = INI_Int("Deaths", pInfo[playerid][Deaths]);
	}
	else
	{
		TotalKills[playerid] = 0;
		TotalKills[playerid] = 0;
	}
I got this errors:
Код:
C:\Users\MaHdy\Desktop\SPA Server original\filterscripts\JLadmin.pwn(400) : error 029: invalid expression, assumed zero
C:\Users\MaHdy\Desktop\SPA Server original\filterscripts\JLadmin.pwn(400) : error 017: undefined symbol "name"
C:\Users\MaHdy\Desktop\SPA Server original\filterscripts\JLadmin.pwn(400) : error 001: expected token: ";", but found "return"
C:\Users\MaHdy\Desktop\SPA Server original\filterscripts\JLadmin.pwn(400) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

What is line 400? Point it out but by reading the error you're using a variable without defining it.

Also:
Код:
  if(!fexist(Jfile))
    {
	TotalKills[playerid] = INI_Int("Kills", pInfo[playerid][Kills]);
        TotalDeaths[playerid] = INI_Int("Deaths", pInfo[playerid][Deaths]);
	}
	else
	{
		TotalKills[playerid] = 0;
		TotalKills[playerid] = 0;
	}
You're checking if the file doesn't exist, and if it doesn't, load it from the file (which doesn't exist).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)