SA-MP Forums Archive
/GodMode Command - 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 (/showthread.php?tid=26570)



/GodMode Command - PinkFloydLover - 17.02.2008

here is a command i tried to make it is pretty simple but i don't know how to do it could anyone tell me specificly how to do it? this is what i got

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/GodMode",true)==0)
{

GetPlayerHealth(playerid);
if(health <100)
SetPlayerHealth(playerid,100);
return 1;}
as you can probably see i have tried to make a command when you type /godmode if your health goes below 100 it will set health back to 100 but it doesent work here are the errors

Код:
C:\samp022server.win32\gamemodes\DM.pwn(752) : error 017: undefined symbol "health"
C:\samp022server.win32\gamemodes\DM.pwn(753) : error 017: undefined symbol "health"
C:\samp022server.win32\gamemodes\DM.pwn(763) : error 076: syntax error in the expression, or invalid function call
C:\samp022server.win32\gamemodes\DM.pwn(795) : warning 202: number of arguments does not match definition
C:\samp022server.win32\gamemodes\DM.pwn(796) : error 017: undefined symbol "health"
C:\samp022server.win32\gamemodes\DM.pwn(2156) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.



Re: /GodMode Command - yom - 17.02.2008

Errors 17 are self explained.

Also that's not godmode, its just a command to reset their health to the max.

Click here if you want a real godmode


Re: /GodMode Command - jnorchanian - 17.02.2008

or just add this command.

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/GodMode",true)==0)
{
SetPlayerHealth(playerid,1000);
return 1;}

it works for me.


Re: /GodMode Command - PinkFloydLover - 17.02.2008

Quote:
Originally Posted by [SWAT
TheFly ]
or just add this command.

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/GodMode",true)==0)
{
SetPlayerHealth(playerid,1000);
return 1;}

it works for me.
yeah but then your health goes down after a long time and plus im trying to learn that thingy which is like if(health <100 or watever ir is


Re: /GodMode Command - ooscar713 - 14.02.2010

lol just do SetPlayerHealth(playerid,10000); on the public OnPlayerUpdate , which will make it so that every second that the server is on, your health goes to 10000, pretty much impossible to defeat unless super hax or admin command


Re: /GodMode Command - owner jacob - 14.02.2010

im jsut taking a guess but u got this from a runescape private server maybe?


Re: /GodMode Command - ДitisOnHuora - 15.02.2010

Here:
pawn Код:
#define INFINITY (Float:0x7F800000)

SetPlayerArmour(playerid, INFINITY);
SetPlayerHealth(playerid, INFINITY);
Have fun! ^^


Re: /GodMode Command - [Mr]Fred - 27.04.2010

Or
Код:
if(strcmp(cmdtext,"/GodMode",true)==0)
{
SetPlayerHealth(playerid,100000);
SendClientMessage(playerid,green,"GODMODE ON");
return
} else {
SendClientMessage(playerid,red,"GODMODE OFF");
SetPlayerHealth(playerid, 100);
}  
}
If you want to enable and diable.


Re: /GodMode Command - dice7 - 27.04.2010

Quote:
Originally Posted by [SU
Ricky ]
Or
Код:
if(strcmp(cmdtext,"/GodMode",true)==0)
{
SetPlayerHealth(playerid,100000);
SendClientMessage(playerid,green,"GODMODE ON");
return
} else {
SendClientMessage(playerid,red,"GODMODE OFF");
SetPlayerHealth(playerid, 100);
}  
}
If you want to enable and diable.
Your code will turn god mode off the moment the player types any other command except /godmode