SA-MP Forums Archive
getting errors? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: getting errors? (/showthread.php?tid=98296)



getting errors? - [mad]MLK - 20.09.2009

this is the code under onplayerdissconect:

Код:
  if(logged[playerid] = 1){
  new file[128], pname[MAX_PLAYER_NAME], plrIP[16];
  GetPlayerName(playerid, pname, sizeof(pname));
  format(file, sizeof(file), "\\Users\\%s.ini", pname);
  GetPlayerIp(playerid, plrIP, sizeof(plrIP));
  dini_IntSet(file, "IP", plrIP);
  }
this is errors:

Код:
C:\Users\user\Desktop\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(228) : warning 211: possibly unintended assignment
C:\Users\user\Desktop\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(233) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Код:
Line 228 = if(logged[playerid] = 1){
Line 233 = dini_IntSet(file, "IP", plrIP);



Re: getting errors? - shady91 - 20.09.2009

Quote:
Originally Posted by [mad
MLK (dino-host.com) ]
this is the code under onplayerdissconect:

Код:
  if(logged[playerid] = 1){
  new file[128], pname[MAX_PLAYER_NAME], plrIP[16];
  GetPlayerName(playerid, pname, sizeof(pname));
  format(file, sizeof(file), "\\Users\\%s.ini", pname);
  GetPlayerIp(playerid, plrIP, sizeof(plrIP));
  dini_IntSet(file, "IP", plrIP);
  }
this is errors:

Код:
C:\Users\user\Desktop\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(228) : warning 211: possibly unintended assignment
C:\Users\user\Desktop\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(233) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Код:
Line 228 = if(logged[playerid] = 1){
Line 233 = dini_IntSet(file, "IP", plrIP);
i dont use dini but your first error is beacuse its a single = should be
pawn Код:
if(logged[playerid] == 1){



Re: getting errors? - ev0lution - 20.09.2009

Quote:
Originally Posted by [mad
MLK (dino-host.com) ]
this is the code under onplayerdissconect:

(code)
Wrong section, this is not 0.3-specific.

Shady91 corrected your first error (well, warning), the second is most likely because IP (or, "plrIP" in your case) is a string, not an integer; use dini_Set instead.