Skripta koju koristim: iStunt
Detaljan opis problema: krenu vracati iz PVarova u enumator spremanje statsa i sad kako je u starom modu bio dini a sa je y_ini, kad sve napravim dode mi oko 8 warninga, nesto sam krivo napravio ali neznam sto :/
Dio skripte:
warnovi
D:\Private\iStunt\pawno\include\reglog.inc(37) : warning 215: expression has no effect
D:\Private\iStunt\pawno\include\reglog.inc(3😎 : warning 215: expression has no effect
D:\Private\iStunt\pawno\include\reglog.inc(39) : warning 215: expression has no effect
D:\Private\iStunt\pawno\include\reglog.inc(40) : warning 215: expression has no effect
D:\Private\iStunt\pawno\include\reglog.inc(41) : warning 215: expression has no effect
D:\Private\iStunt\pawno\include\reglog.inc(42) : warning 215: expression has no effect
D:\Private\iStunt\pawno\include\reglog.inc(43) : warning 215: expression has no effect
D:\Private\iStunt\gamemodes\iStunt.pwn(2711) : warning 204: symbol is assigned a value that is never used: "Server" //ovaj zanemarite
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
8 Warnings.
linije, sve su iste samo se razlikuju po funkciji
idu po redu:
if(!strcmp(name, "Admin")) PlayerInfo;
if(!strcmp(name, "VIP")) PlayerInfo;
if(!strcmp(name, "Money")) PlayerInfo;
if(!strcmp(name, "Score")) PlayerInfo;
if(!strcmp(name, "Kills")) PlayerInfo;
if(!strcmp(name, "Deaths")) PlayerInfo;
if(!strcmp(name, "Skin")) PlayerInfo;
Neke slike/video za lakse dobivanje pomoci(neobavezno):
[Pomoc] warninzi oko sspremanja statsa
745
pregleda
9
postova
5. Jul 2011.
Ovo ti nema veze sa statsima -.-
Samo si napravio ako se ispunjava uvjet "if(!strcmp(name, "Admin"))" da ce se dogoditi "PlayerInfo;" što nema nikakve logike... Stavi pod /* i */
Samo si napravio ako se ispunjava uvjet "if(!strcmp(name, "Admin"))" da ce se dogoditi "PlayerInfo;" što nema nikakve logike... Stavi pod /* i */
5. Jul 2011.
brate ja nista nisam to radio, sve paradox, i sad kad sam krenuo iz PVarova u enumator dobijem te warnove, na tom mjestu su bili PVarovi
evo kako je bilo s PVarovima
native WP_Hash(buffer[], len, const str[]);
forward LoadUserData(playerid, name[], value[]);
#define INI_Exists(%0) fexist(%0)
#define SetPVarIntEx(%0,%1,%2,%3) SetPVarInt(%0, %1, GetPVarInt(%0, %1) %2 %3)
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define USER_FILE "Korisnici/%s.ini"
#define VERSION "1.0.0"
public LoadUserData(playerid, name[], value[])
{
if(!strcmp(name, "Lozinka"))
{
new
hashPassword;
WP_Hash(hashPassword, 129, value);
SetPVarString(playerid, "Lozinka", hashPassword);
}
if(!strcmp(name, "Admin")) SetPVarInt(playerid, "Admin", strval(value));
if(!strcmp(name, "VIP")) SetPVarInt(playerid, "VIP", strval(value));
if(!strcmp(name, "Money")) SetPVarInt(playerid, "Money", strval(value));
if(!strcmp(name, "Score")) SetPVarInt(playerid, "Score", strval(value));
if(!strcmp(name, "Kills")) SetPVarInt(playerid, "Kills", strval(value));
if(!strcmp(name, "Deaths")) SetPVarInt(playerid, "Deaths", strval(value));
if(!strcmp(name, "Skin")) SetPVarInt(playerid, "Skin", strval(value));
}
OnPlayerRegister(playerid, password[])
{
new
hashPassword,
uFile;
format(uFile, 35, USER_FILE, GetName(playerid));
new
INI:playerFile = INI_Open(uFile);
WP_Hash(hashPassword, 129, password);
INI_WriteString(playerFile, "Lozinka", hashPassword);
INI_WriteInt(playerFile, "Admin", 0);
INI_WriteInt(playerFile, "VIP", 0);
INI_WriteInt(playerFile, "Money", 200);
INI_WriteInt(playerFile, "Score", 0);
INI_WriteInt(playerFile, "Kills", 0);
INI_WriteInt(playerFile, "Deaths", 0);
INI_WriteInt(playerFile, "Skin", 0);
INI_Close(playerFile);
SetPVarInt(playerid, "Registered", 1);
SetPVarInt(playerid, "Logged", 1);
return 1;
}
OnPlayerLogin(playerid, password[])
{
new
hashPassword,
Password,
uFile;
format(uFile, 35, USER_FILE, GetName(playerid));
INI_ParseFile(uFile, "LoadUserData", .bExtra = true, .extra = playerid);
GetPVarString(playerid, "Lozinka", Password, 129);
WP_Hash(hashPassword, 129, password);
if(!strcmp(Password, hashPassword, false, 35))
{
if(GetPVarInt(playerid, "LoginTries") == 3) Kick(playerid);
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "iStunt - Logiranje", "{FF00EA}Upisali ste pogrešnu lozinku!\n\n\n{F81414}Molimo pokušajte ponovo!", "Login", "Leave");
SetPVarIntEx(playerid, "LoginTries", +, 1);
}
}
return 1;
}
OnPlayerLogout(playerid)
{
new
uFile;
format(uFile, 35, USER_FILE, GetName(playerid));
new
INI:playerFile = INI_Open(uFile);
INI_WriteInt(playerFile, "Admin", GetPVarInt(playerid, "Admin"));
INI_WriteInt(playerFile, "VIP", GetPVarInt(playerid, "VIP"));
INI_WriteInt(playerFile, "Money", GetPlayerMoney(playerid));
INI_WriteInt(playerFile, "Score", GetPlayerScore(playerid));
INI_WriteInt(playerFile, "Kills", GetPVarInt(playerid, "Kills"));
INI_WriteInt(playerFile, "Deaths", GetPVarInt(playerid, "Deaths"));
INI_WriteInt(playerFile, "Skin", GetPVarInt(playerid, "Skin"));
INI_Close(playerFile);
return 1;
}
evo kako je bilo s PVarovima
native WP_Hash(buffer[], len, const str[]);
forward LoadUserData(playerid, name[], value[]);
#define INI_Exists(%0) fexist(%0)
#define SetPVarIntEx(%0,%1,%2,%3) SetPVarInt(%0, %1, GetPVarInt(%0, %1) %2 %3)
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define USER_FILE "Korisnici/%s.ini"
#define VERSION "1.0.0"
public LoadUserData(playerid, name[], value[])
{
if(!strcmp(name, "Lozinka"))
{
new
hashPassword;
WP_Hash(hashPassword, 129, value);
SetPVarString(playerid, "Lozinka", hashPassword);
}
if(!strcmp(name, "Admin")) SetPVarInt(playerid, "Admin", strval(value));
if(!strcmp(name, "VIP")) SetPVarInt(playerid, "VIP", strval(value));
if(!strcmp(name, "Money")) SetPVarInt(playerid, "Money", strval(value));
if(!strcmp(name, "Score")) SetPVarInt(playerid, "Score", strval(value));
if(!strcmp(name, "Kills")) SetPVarInt(playerid, "Kills", strval(value));
if(!strcmp(name, "Deaths")) SetPVarInt(playerid, "Deaths", strval(value));
if(!strcmp(name, "Skin")) SetPVarInt(playerid, "Skin", strval(value));
}
OnPlayerRegister(playerid, password[])
{
new
hashPassword,
uFile;
format(uFile, 35, USER_FILE, GetName(playerid));
new
INI:playerFile = INI_Open(uFile);
WP_Hash(hashPassword, 129, password);
INI_WriteString(playerFile, "Lozinka", hashPassword);
INI_WriteInt(playerFile, "Admin", 0);
INI_WriteInt(playerFile, "VIP", 0);
INI_WriteInt(playerFile, "Money", 200);
INI_WriteInt(playerFile, "Score", 0);
INI_WriteInt(playerFile, "Kills", 0);
INI_WriteInt(playerFile, "Deaths", 0);
INI_WriteInt(playerFile, "Skin", 0);
INI_Close(playerFile);
SetPVarInt(playerid, "Registered", 1);
SetPVarInt(playerid, "Logged", 1);
return 1;
}
OnPlayerLogin(playerid, password[])
{
new
hashPassword,
Password,
uFile;
format(uFile, 35, USER_FILE, GetName(playerid));
INI_ParseFile(uFile, "LoadUserData", .bExtra = true, .extra = playerid);
GetPVarString(playerid, "Lozinka", Password, 129);
WP_Hash(hashPassword, 129, password);
if(!strcmp(Password, hashPassword, false, 35))
{
if(GetPVarInt(playerid, "LoginTries") == 3) Kick(playerid);
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "iStunt - Logiranje", "{FF00EA}Upisali ste pogrešnu lozinku!\n\n\n{F81414}Molimo pokušajte ponovo!", "Login", "Leave");
SetPVarIntEx(playerid, "LoginTries", +, 1);
}
}
return 1;
}
OnPlayerLogout(playerid)
{
new
uFile;
format(uFile, 35, USER_FILE, GetName(playerid));
new
INI:playerFile = INI_Open(uFile);
INI_WriteInt(playerFile, "Admin", GetPVarInt(playerid, "Admin"));
INI_WriteInt(playerFile, "VIP", GetPVarInt(playerid, "VIP"));
INI_WriteInt(playerFile, "Money", GetPlayerMoney(playerid));
INI_WriteInt(playerFile, "Score", GetPlayerScore(playerid));
INI_WriteInt(playerFile, "Kills", GetPVarInt(playerid, "Kills"));
INI_WriteInt(playerFile, "Deaths", GetPVarInt(playerid, "Deaths"));
INI_WriteInt(playerFile, "Skin", GetPVarInt(playerid, "Skin"));
INI_Close(playerFile);
return 1;
}
5. Jul 2011.
napravio sam po tut i sve radi ali aj sam pomozite oko /admins komande, stavio sam foreach(Player, i) i onda izbacuje error da je i ne definiran
CMD:admins(playerid,params[])
{
new aMsg;
SendClientMessage(playerid, COLOR_KRED, "<~~ Administratori Online ~~>");
foreach(Player, i)
if(PlayerInfo( == 1)
{
format(aMsg, 127, "Gamemaster: %s", GetName(i));
SendClientMessage(playerid, COLOR_LIGHTBLUE, aMsg);
}
else if(PlayerInfo( == 2)
{
format(aMsg, 128, "Administrator: %s", GetName(i));
SendClientMessage(playerid, COLOR_LIGHTBLUE, aMsg);
}
else if(PlayerInfo( == 3)
{
format(aMsg, 129, "Owner: %s", GetName(i));
SendClientMessage(playerid, COLOR_LIGHTBLUE, aMsg);
}
else SendClientMessage(playerid, COLOR_LIGHTBLUE, "Trenutno nema administratora online!");
return 1;
}
D:\Private\iStunt\gamemodes\iStunt.pwn(1554) : error 012: invalid function call, not a valid address
D:\Private\iStunt\gamemodes\iStunt.pwn(1554) : error 029: invalid expression, assumed zero
D:\Private\iStunt\gamemodes\iStunt.pwn(1554) : error 017: undefined symbol "i"
D:\Private\iStunt\gamemodes\iStunt.pwn(1554) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
CMD:admins(playerid,params[])
{
new aMsg;
SendClientMessage(playerid, COLOR_KRED, "<~~ Administratori Online ~~>");
foreach(Player, i)
if(PlayerInfo( == 1)
{
format(aMsg, 127, "Gamemaster: %s", GetName(i));
SendClientMessage(playerid, COLOR_LIGHTBLUE, aMsg);
}
else if(PlayerInfo( == 2)
{
format(aMsg, 128, "Administrator: %s", GetName(i));
SendClientMessage(playerid, COLOR_LIGHTBLUE, aMsg);
}
else if(PlayerInfo( == 3)
{
format(aMsg, 129, "Owner: %s", GetName(i));
SendClientMessage(playerid, COLOR_LIGHTBLUE, aMsg);
}
else SendClientMessage(playerid, COLOR_LIGHTBLUE, "Trenutno nema administratora online!");
return 1;
}
D:\Private\iStunt\gamemodes\iStunt.pwn(1554) : error 012: invalid function call, not a valid address
D:\Private\iStunt\gamemodes\iStunt.pwn(1554) : error 029: invalid expression, assumed zero
D:\Private\iStunt\gamemodes\iStunt.pwn(1554) : error 017: undefined symbol "i"
D:\Private\iStunt\gamemodes\iStunt.pwn(1554) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
5. Jul 2011.
CMD:admins(playerid,params[])
{
new aMsg;
SendClientMessage(playerid, COLOR_KRED, "<~~ Administratori Online ~~>");
foreach(Player, i)
{
if(PlayerInfo == 1)
{
format(aMsg, 127, "Gamemaster: %s", GetName(i));
SendClientMessage(playerid, COLOR_LIGHTBLUE, aMsg);
}
else if(PlayerInfo == 2)
{
format(aMsg, 128, "Administrator: %s", GetName(i));
SendClientMessage(playerid, COLOR_LIGHTBLUE, aMsg);
}
else if(PlayerInfo == 3)
{
format(aMsg, 129, "Owner: %s", GetName(i));
SendClientMessage(playerid, COLOR_LIGHTBLUE, aMsg);
}
}
return 1;
}Pazi na zagrade, pogledaj svoj post.
I ovo
if(PlayerInfo( == 1) ide ovako if(PlayerInfo == 1)EDIT: I zasto kod formatiranja poruke povecavas duzinu? + sto je nepotrebna tolika duzina.
Morate biti prijavljeni da biste odgovorili na ovu temu.
Prijava