SA-MP Forums Archive
God Mode Help!!!! - 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: God Mode Help!!!! (/showthread.php?tid=598818)



God Mode Help!!!! - ManIsHere - 17.01.2016

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


Re: God Mode Help!!!! - Amunra - 17.01.2016

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


Re: God Mode Help!!!! - Sew_Sumi - 17.01.2016

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]...


Re: God Mode Help!!!! - Golimad - 17.01.2016

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;
}