CMD:god(playerid, params[])
{
if(IsPlayerConnected(playerid))
if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on Admin Duty.");
if(PlayerInfo[playerid][pAdmin] < 2) {
SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
return 1;
}
if(GodMode[playerid] == 0)
SendClientMessage(playerid, COLOR_GREY, "You are now in God Mode!");
{
SetPlayerHealth(playerid, 999999);
SetPlayerArmour(playerid, 999999);
}
else if(GodMode[playerid] == 1)
SendClientMessage(playerid, COLOR_GREY, "You have turned off your God Mode!");
{
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
}
return 1;
}
C:\Documents and Settings\USER\Desktop\HGRP\gamemodes\HGRP.pwn(44513) : error 029: invalid expression, assumed zero C:\Documents and Settings\USER\Desktop\HGRP\gamemodes\HGRP.pwn(44513) : warning 215: expression has no effect C:\Documents and Settings\USER\Desktop\HGRP\gamemodes\HGRP.pwn(44513) : error 001: expected token: ";", but found "if" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
CMD:god(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 2) { SetPlayerHealth(playerid, 100000); SetPlayerArmour(playerid, 100000); } return 1; }
CMD:god(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on Admin Duty.");
if(PlayerInfo[playerid][pAdmin] < 2)
{
SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
return 1;
}
if(GodMode[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "You are now in God Mode!");
SetPlayerHealth(playerid, 999999);
SetPlayerArmour(playerid, 999999);
}
else if(GodMode[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "You have turned off your God Mode!");
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
}
}
return 1;
}
try this
PHP код:
dont put sendclientmessage right after then, put it in the brackets along with the setplayerhealth and armour |
SetPlayerHealth(playerid, 999999);
#define INFINITE (Float:0x7F800000)
SetPlayerHealth(playerid, INFINITE);