30.07.2011, 15:53
No admin rights, damn!
This is my code for example!
It's for the User EazyE(me) and for samtey, too!
When I type /kick, /god, /energy he says: You are not an administrator!
The teleport funtion /goto doesn't work either: SERVER:Unknown Command![/QUOTE]
The commands? Here:
This is my code for example!
Код:
Password=(I won't say) Cash=0 Admin=1 Score=0
When I type /kick, /god, /energy he says: You are not an administrator!
The teleport funtion /goto doesn't work either: SERVER:Unknown Command![/QUOTE]
The commands? Here:
pawn Код:
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;
}