#1

im making a godmode but i get 1 error

Код:
#define FILTERSCRIPT
#include a_samp
#include zcmd

CMD:ihealth(playerid,params[])
{
if(IsPlayerAdmin(playerid))
SetPlayerHealth(playerid,99999.99);
SetPlayerArmour(playerid,99999.99);
SendClientMessage(playerid,0xC2A2DAAA,"infinite health is activated");
}
else
SendClientMessage(playerid,0xC2A2DAAA,"You Need To be rcon admin");
}
Код:
infinitehealth.pwn(12) : error 010: invalid function or declaration
whats the problem?
Reply
#2

Код:
CMD:ihealth(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xC2A2DAAA, "You need to be an RCON admin!");
SetPlayerHealth(playerid,99999.99);
SetPlayerArmour(playerid,99999.99);
SendClientMessage(playerid,0xC2A2DAAA,"infinite health is activated");
}
Try this!

EXPLANATION CODE:-

Well, you should have added another "}" when you put else, but here's another method of doing so. ^
I changed "else" to "return".

if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xC2A2DAAA, "You need to be an RCON admin!");

This line means "If the player is not admin, the server will return the following message". [Note:- This symbol "!" means if not].
Reply
#3

thanks +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)