SA-MP Forums Archive
Godmode Command Error - 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: Godmode Command Error (/showthread.php?tid=205137)



Godmode Command Error - Linus- - 31.12.2010

Hey
why getting errors?
Code:
Quote:

new pGod;
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/god", cmdtext, true, 10) == 0)
{
if(pGod[playerid] == 0)
{
pGod[playerid] = 1;
SetPlayerHealth(playerid,100000);
SendClientMessage(playerid, 0xFFFF2AFF,"Godmode ON");
} else {
pGod[playerid] = 0;
SendClientMessage(playerid, 0xFFFF2AFF,"Godmode OFF");
SetPlayerHealth(playerid, 100);
}
return 1;
}
return 0;
}

Errors:
Quote:

C:\Documents and Settings\$unny\Desktop\sss.pwn( : error 028: invalid subscript (not an array or too many subscripts): "pGod"
C:\Documents and Settings\Linus\Desktop\sss.pwn( : warning 215: expression has no effect
C:\Documents and Settings\Linus\Desktop\sss.pwn( : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Linus\Desktop\sss.pwn( : error 029: invalid expression, assumed zero
C:\Documents and Settings\Linus\Desktop\sss.pwn( : fatal error 107: too many error messages on one line

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


4 Errors.




Re: Godmode Command Error - HyperZ - 31.12.2010

Change:
pawn Код:
new pGod;
To:
pawn Код:
new pGod[MAX_PLAYERS];



Re: Godmode Command Error - Linus- - 31.12.2010

Thanks you Clive you help me second time, sorry bad english.