Godmode Command Error
#1

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.

Reply
#2

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)