SA-MP Forums Archive
Help PlayerInfo - 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: Help PlayerInfo (/showthread.php?tid=481334)



Help PlayerInfo - MatriXgaMer - 15.12.2013

Hey, I get This Error when I am trying to make an Admin Command.
pawn Код:
C:\Users\matriXgameR\Desktop\Pawno\gamemodes\BGRP.pwn(147) : error 017: undefined symbol "PlayerInfo"
C:\Users\matriXgameR\Desktop\Pawno\gamemodes\BGRP.pwn(147) : warning 215: expression has no effect
C:\Users\matriXgameR\Desktop\Pawno\gamemodes\BGRP.pwn(147) : error 001: expected token: ";", but found "]"
C:\Users\matriXgameR\Desktop\Pawno\gamemodes\BGRP.pwn(147) : error 029: invalid expression, assumed zero
C:\Users\matriXgameR\Desktop\Pawno\gamemodes\BGRP.pwn(147) : 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.
My Enum:
pawn Код:
enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pKills,
    pDeaths
}
new PlayerInfo[MAX_PLAYERS][pInfo];
The Command:
pawn Код:
CMD:uzmigun(playerid, params[])
{
if(!PlayerInfo[playerid][pAdmin]) = 1) return SendClientMessage(playerid, COLOR_RED, "[BG:RP] Niste ovlascenji da koristite ovu komandu.");
{
SendClientMessage(playerid, COLOR_RED, "Ova komanda je u izradi.");
}
return 1;
}
HELP


Re: Help PlayerInfo - Hybris - 15.12.2013

try adding this variable
Код:
new pInfo[MAX_PLAYERS][PlayerInfo];



Re: Help PlayerInfo - Patrick - 15.12.2013

Quote:
Originally Posted by Hybris
Посмотреть сообщение
try adding this variable
Код:
new PlayerInfo[MAX_PLAYERS];
Nope

You are using incorrect Operator

Change
pawn Код:
if(!PlayerInfo[playerid][pAdmin]) = 1) return SendClientMessage(playerid, COLOR_RED, "[BG:RP] Niste ovlascenji da koristite ovu komandu.");
To
pawn Код:
if(PlayerInfo[playerid][pAdmin]) != 1) return SendClientMessage(playerid, COLOR_RED, "[BG:RP] Niste ovlascenji da koristite ovu komandu.");



Re: Help PlayerInfo - ikbenremco - 15.12.2013

Make sure the command is below the enum.


Re: Help PlayerInfo - MatriXgaMer - 15.12.2013

Still not working...
pawn Код:
C:\Users\matriXgameR\Desktop\Pawno\filterscripts\Loginandregister.pwn(147) : error 049: invalid line continuation
C:\Users\matriXgameR\Desktop\Pawno\filterscripts\Loginandregister.pwn(147) : error 055: start of function body without function header
C:\Users\matriXgameR\Desktop\Pawno\filterscripts\Loginandregister.pwn(20) : error 010: invalid function or declaration
C:\Users\matriXgameR\Desktop\Pawno\filterscripts\Loginandregister.pwn(147) : error 010: invalid function or declaration
C:\Users\matriXgameR\Desktop\Pawno\filterscripts\Loginandregister.pwn(147) : error 017: undefined symbol "PlayerInfo"
C:\Users\matriXgameR\Desktop\Pawno\filterscripts\Loginandregister.pwn(147) : error 009: invalid array size (negative, zero or out of bounds)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


6 Errors.



Re: Help PlayerInfo - J4mmyHD - 15.12.2013

pawn Код:
CMD:uzmigun(playerid, params[])
{
     if(PlayerInfo[playerid][pAdmin]) != 1) return SendClientMessage(playerid, COLOR_RED, "[BG:RP] Niste ovlascenji da koristite ovu komandu.");
     {
          SendClientMessage(playerid, COLOR_RED, "Ova komanda je u izradi.");
     }
     return 1;
}



Re: Help PlayerInfo - Chenko - 15.12.2013

You are using an incorrect operator and you also have an extra parentheses

Код:
if(!PlayerInfo[playerid][pAdmin]) = 1) return SendClientMessage(playerid, COLOR_RED, "[BG:RP] Niste ovlascenji da koristite ovu komandu.");
Should be

Код:
if(PlayerInfo[playerid][pAdmin] != 1) return SendClientMessage(playerid, COLOR_RED, "[BG:RP] Niste ovlascenji da koristite ovu komandu.");