30.07.2011, 16:40
PHP код:
CMD:energy(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0x0022FFFF, "You are not an administrator, so you can't use this command!");
new ID;
if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0x0022FFFF, "USAGE: /energy");
SetPlayerHealth(ID, 100);
return 1;
}
CMD:kick(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an administrator, so you can't use this command!");
new PID;
if(sscanf(params, "u", PID)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /kick [playerid] [reason]");
if(!IsPlayerConnected(PID)) return SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");
Kick(PID);
return 1;
}
CMD:teleport(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an administrator, so you can't use this command!");
new ID;
if(sscanf(params, "u", ID)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /goto [playerid]");
if(!IsPlayerConnected(ID)) SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(ID, x+1, y+1, z);
return 1;
}
CMD:god(playerid, params[])
{
#pragma unused params
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not an admin");
if(!HasGod[playerid])
{
HasGod[playerid] = 1;
SendClientMessage(playerid, -1, "God mode turned on!");
}
else
{
HasGod[playerid] = 0;
SendClientMessage(playerid, -1, "God mode turned off!");
}
return 1;
}