/GodMode Command
#1

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.
Reply
#2

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
Reply
#3

or just add this command.

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

it works for me.
Reply
#4

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
Reply
#5

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
Reply
#6

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

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

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

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.
Reply
#9

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)