Problem with Godmode - 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: Problem with Godmode (
/showthread.php?tid=522508)
Problem with Godmode -
GreenHood - 27.06.2014
I got a problem with the godmode.
pawn Код:
if (strcmp(cmd, "/godmode", true) == 0)
{
if (AccInfo[playerid][pVip] <=1)
{
if(AccInfo[playerid][God] == 0)
{
AccInfo[playerid][God] = 1;
SetPlayerHealth(playerid, 35000);
SendClientMessage(playerid,COLOR_GREEN, "* Godmode enabled.");
}
else
{
AccInfo[playerid][God] = 0;
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid,red,"* Godmode disabled.");
}
return PlayerPlaySound(playerid, 1052, 0.0, 0.0, 10.0);
}
else return SendClientMessage(playerid,COLOR_WHITE,"* You're not a VIP to perform this command.");
}
The code seems to be alright, the only problem is that I can still die when I'm falling from a building. The health refills only after few seconds.
What is wrong?
Re: Problem with Godmode -
Eth - 27.06.2014
pawn Код:
if (strcmp(cmd, "/godmode", true) == 0)
{
if (AccInfo[playerid][pVip] <=1)
{
if(AccInfo[playerid][God] == 0)
{
AccInfo[playerid][God] = 1;
SetPlayerHealth(playerid, 9999999999);
SendClientMessage(playerid,COLOR_GREEN, "* Godmode enabled.");
}
else if(AccInfo[playerid][God] == 1)
{
AccInfo[playerid][God] = 0;
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid,red,"* Godmode disabled.");
}
return PlayerPlaySound(playerid, 1052, 0.0, 0.0, 10.0);
}
else return SendClientMessage(playerid,COLOR_WHITE,"* You're not a VIP to perform this command.");
}
this will work :P also show us onplayerupdate