God Mode Help!!!!
#1

Hi Guys i am Again here. i am making /god CMD but i am Gettting Some Errors-

Quote:

array must be indexed (variable "PlayerInfo")
array sizes do not match, or destination array is too small
array must be indexed (variable "PlayerInfo")
array must be indexed (variable "PlayerInfo")

And here is my CMD:
Quote:

CMD:god(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
if PlayerInfo[playerid]== false;
{
SetPlayerHealth(playerid, 99999999);
SendClientMessage(playerid, COLOR_GREEN, "GodMode ON!");
PlayerInfo[playerid]= true;
}
else if(PlayerInfo[playerid]== true;
{
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, COLOR_RED, "GodMode OFF!");
PlayerInfo[playerid]= false;
}
}
else return SendClientMessage(playerid, COLOR_WHITE, "you are not authorised to use that Command");
return 1;
}
Can Anyone help me
Reply
#2

PHP код:
if (PlayerInfo[playerid]== false)// Your Code if PlayerInfo[playerid]== false; Wrong Definition xD 
PHP код:
else if(PlayerInfo[playerid]== true)// Your Code else if(PlayerInfo[playerid]== true; wrong xD 
Edited Change this
Reply
#3

Quote:
Originally Posted by Amunra
Посмотреть сообщение
PHP код:
if (PlayerInfo[playerid]== false)// Your Code if PlayerInfo[playerid]== false; Wrong Definition xD 
PHP код:
else if(PlayerInfo[playerid]== true)// Your Code else if(PlayerInfo[playerid]== true; wrong xD 
Edited Change this
That... Isn't going to address

Код:
if(PlayerInfo[playerid][pAdmin] >= 3)
{
if PlayerInfo[playerid]== false;
that.

Surely you can't have PlayerInfo[playerid], along with PlayerInfo[playerid][Admin]...
Reply
#4

your enum shall now become :
enum unameit
{
pAdmin,
...
bool: pGodMode
}
Код:
CMD:god(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
if (PlayerInfo[playerid][pGodMode]== false)
{
SetPlayerHealth(playerid, 0x7FFFFFFF);
SendClientMessage(playerid, COLOR_GREEN, "GodMode ON!");
PlayerInfo[playerid][pGodMode]= true;
}
else if(PlayerInfo[playerid][pGodMode]== true)
{
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, COLOR_RED, "GodMode OFF!");
PlayerInfo[playerid][pGodMode]= false;
}
}
else return SendClientMessage(playerid, COLOR_WHITE, "you are not authorised to use that Command");
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)