Password=(I won't say) Cash=0 Admin=1 Score=0
CMD:energy(playerid, params[])
{
if(IsPlayerAdmin(playerid)) {
new ID;
if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0x0022FFFF, "USAGE: /energy");
SetPlayerHealth(ID, 100);
}
else
{
SendClientMessage(playerid, 0x0022FFFF, "You are not an administrator, so you can't use this command!");
}
return 1;
}
CMD:kick(playerid, params[])
{
if(IsPlayerAdmin(playerid)) {
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);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not an administrator, so you can't use this command!");
}
return 1;
}
CMD:teleport(playerid, params[])
{
if(IsPlayerAdmin(playerid)) {
new ID;
if(sscanf(params, "u", ID)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /goto [playerid]");
else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");
else
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(ID, x+1, y+1, z);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not an administrator, so you can't use this command!");
}
return 1;
}
CMD:god(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
if(HasGod[playerid] == 0)
{
HasGod[playerid] = 1;
SendClientMessage(playerid, -1, "God mode turned on!");
}
else if(HasGod[playerid] == 1)
{
HasGod[playerid] = 0;
SendClientMessage(playerid, -1, "God mode turned off!");
}
}
else return SendClientMessage(playerid, -1, "You are not an admin");
return 1;
}
if(IsPlayerAdmin(playerid))
if(PlayerInfo[playerid][pAdmin] >= 1)
CMD:energy(playerid, params[]) {
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0x0022FFFF, "You are not an administrator, so you can't use this command!");
SetPlayerHealth(playerid, 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, reason[65], r_string[128];
if(sscanf(params, "uz", PID, reason)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /kick [playerid] [reason]");
if(PID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");
if(isnull(reason)) format(r_string, sizeof(r_string), "%s has kicked %s, reason: No reason", GetPlayerNameEx(playerid), GetPlayerNameEx(PID));
else format(r_string, sizeof(r_string), "%s has kicked %s, reason: %s", GetPlayerNameEx(playerid), GetPlayerNameEx(PID), reason);
SendClientMessageToAll(-1, r_string);
Kick(PID);
return 1;
}
stock GetPlayerNameEx(playerid) {
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
return PlayerName;
}
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)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /goto [playerid]");
if(ID == INVALID_PLAYER_ID) return 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[]) {
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 if(HasGod[playerid]) {
HasGod[playerid] = 0;
SendClientMessage(playerid, -1, "God mode turned off!");
}
return 1;
}
CMD:energy(playerid, params[]) {
new ID;
if(PlayerInfo[playerid][pAdmin] >= 1) return SendClientMessage(playerid, 0x0022FFFF, "You are not an administrator, so you can't use this command!");
SetPlayerHealth(ID, 100);
return 1;
}
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;
}
THE OTHERS ARE RIGHT, ONLY /energy doesn't work!
![]() I tried it with rcon_login! Still didn't work! Should I give it a try with if(PlayerInfo[playerid][pAdmin] >= 1) instead of if(!IsPlayerAdmin(playerid)) |
CMD:energy(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] || IsPlayerAdmin(playerid))
{
SetPlayerHealth(playerid, 100);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
}
return 1;
}
CMD:energy(playerid, params[])
{
if(!IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, 0x0022FFFF, "You are not an administrator, so you can't use this command!");
return 1;
}
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, COLOR_GREY, "Health has been restored to 100.");
return 1;
}
pawn Код:
EDIT: I'm slow, very, very slow. |