[HELP]Admin Cmds.
#1

Can annyone help me? Server wont start!

I have this on top:

Код:
#include <mysql>
#include <zcmd>
#include <sscanf>
Код:
CMD:apm(playerid, params[])
{

	if(admin[playerid] < 1) return SendClientMessage(playerid, COLOR_RED, "Your not an admin.");
    new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
    if(sscanf(params, "us", id, str2))
    {
        SendClientMessage(playerid, 0xFF0000FF, "Usage: /apm [Player ID] [Message]");
        return 1;
    }
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "The Player Is not connected");
    {
        GetPlayerName(playerid, Name1, sizeof(Name1));
        GetPlayerName(id, Name2, sizeof(Name2));
        format(str, sizeof(str), "PM Sent To %s(ID %d): {88AA88}%s{FFFFFF}", Name2, id, str2);
        SendClientMessage(playerid, 0xFF9900AA, str);
        format(str, sizeof(str), "PM From Admin %s(ID %d): {88AA88}%s{FFFFFF}", Name1, playerid, str2);
        SendClientMessage(id, 0xFF9900AA, str);
    }
    return 1;
}
CMD:warn(playerid, params[])
{

	if(admin[playerid] < 1) return SendClientMessage(playerid, COLOR_RED, "Your not an admin.");
    new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
    if(sscanf(params, "us", id, str2))
    {
        SendClientMessage(playerid, 0xFF0000FF, "Usage: /warn [Player ID] [Warning]");
        return 1;
    }
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "The Player Is not connected");
    {
        GetPlayerName(playerid, Name1, sizeof(Name1));
        GetPlayerName(id, Name2, sizeof(Name2));
        format(str, sizeof(str), "Wrning Sent To %s(ID %d): {88AA88}%s{FFFFFF}", Name2, id, str2);
        SendClientMessage(playerid, 0xFF9900AA, str);
        format(str, sizeof(str), "Warning From Admin's: {88AA88}%s{FFFFFF}", str2);
        SendClientMessage(id, 0xFF9900AA, str);
    }
    return 1;
}
CMD:setadmin(playerid, params[])
{
 	if(admin[playerid]!=4) return SendClientMessage(playerid, COLOR_RED, "Your not an admin lvl 4.");
	new id, level,string[128],string1[128],name[MAX_PLAYERS];
	if(sscanf(params,"ui", id, level)) return SendClientMessage(playerid, COLOR_RED, "USAGE:/setadmin [id] [level]");
	if(level>4) return SendClientMessage(playerid, COLOR_RED, "Highest level is 4");
	admin[id] = level;
	format(string, sizeof(string), "~You have been made an admin of level %d~",level);
	SendClientMessage(id, COLOR_ORANGE, string);
	GetPlayerName(id, name, sizeof(name));
	format(string1, sizeof(string1), "~You have set %s an Admin of level %d~", name, level);
	SendClientMessage(playerid, COLOR_ORANGE, string1);
	return 1;

}
CMD:kick(playerid,params[])
{
	new str, id;
	if(admin[playerid] < 1) return SendClientMessage(playerid, COLOR_RED, "Your not an admin with right lvl.");
    if(sscanf(params,"us[128];",id,str))
	{
	    SendClientMessage(playerid,0xFF0000FF,"USAGE: /kick [ID] [REASON]");
	    return 1;
	}
	if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"Invalid ID");
	if(admin[playerid] < 1) return SendClientMessage(playerid, COLOR_RED, "Your not an admin allowed to use this.");
    new string[128];
	new nname[MAX_PLAYER_NAME];
	GetPlayerName(id,name,MAX_PLAYER_NAME);
	GetPlayerName(playerid,nname,MAX_PLAYER_NAME);
	format(string,sizeof(string),"You have been kicked for: %s",str);
	SendClientMessage(id,COLOR_ORANGE,string);
	format(string,sizeof(string),"You have kicked %s for: %s",name,str);
	SendClientMessage(playerid,COLOR_ORANGE,string);
	format(string,sizeof(string),"%s have been kicked for: %s",name, str);
	SendClientMessageToAll(COLOR_ORANGE,string);
	Kick(id);
	return 1;
}
CMD:ban(playerid,params[])
{
	new str, id;
	if(admin[playerid] < 2) return SendClientMessage(playerid, COLOR_RED, "Your not an admin with right lvl.");
    if(sscanf(params,"us[128];",id,str))
	{
 	SendClientMessage(playerid,0xFF0000FF,"USAGE: /ban [ID] [REASON]");
    return 1;
	}
	if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"Invalid ID");
	if(admin[playerid] < 1) return SendClientMessage(playerid, COLOR_RED, "Your not an admin allowed to use this.");
    new string[128];
	new name[MAX_PLAYER_NAME];
	GetPlayerName(id,name,MAX_PLAYER_NAME);
	format(string,sizeof(string),"You have been banned for: %s",str);
	SendClientMessage(id,COLOR_ORANGE,string);
	format(string,sizeof(string),"You have banned %s for: %s",name,str);
	SendClientMessage(playerid,COLOR_ORANGE,string);
	format(string,sizeof(string),"%s have been banned.",name);
	SendClientMessageToAll(COLOR_ORANGE,string);
	Ban(id);
	return 1;
}
CMD:adminduty(playerid, params[])
{
	if(admin[playerid] < 4) return SendClientMessage(playerid, COLOR_RED, "Your not an admin with right lvl.");
    new string[128];
	format(string,sizeof(string),"******* WATCH OUT! %s is now on admin duty! WATCH OUT! *******",PlayerName(playerid));
	SendClientMessage(playerid,COLOR_RED,string);
	SetPlayerArmour(playerid, 9999);
	SetPlayerHealth(playerid, 9999);
	GivePlayerWeapon(playerid, 38, 99999);
	GivePlayerWeapon(playerid, 45, 99999);
	GivePlayerWeapon(playerid, 42, 99999);
	GivePlayerWeapon(playerid, 16, 99999);
	GivePlayerWeapon(playerid, 9, 99999);
	return 1;
}
CMD:freeze(playerid, params[])
{
    if(admin[playerid] < 2) return SendClientMessage(playerid, COLOR_RED, "Your not an admin with right lvl.");
    new iPlayer;
    if(sscanf(params, "i", iPlayer)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /freeze [Player ID]");
    if(!IsPlayerConnected(iPlayer)) return SendClientMessage(playerid, 0xFF0000FF, "Player is not connected.");

    TogglePlayerControllable(iPlayer, false);
    SendClientMessage(iPlayer, 0x00FFFF, "You are frozen!");
    return true;
}
CMD:unfreeze(playerid, params[])
{
    if(admin[playerid] < 1) return SendClientMessage(playerid, COLOR_RED, "Your not an admin with right lvl.");
    new iPlayer;
    if(sscanf(params, "i", iPlayer)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /unfreeze [Player ID]");
    if(!IsPlayerConnected(iPlayer)) return SendClientMessage(playerid, 0xFF0000FF, "Player is not connected.");

    TogglePlayerControllable(iPlayer, 1);
    SendClientMessage(iPlayer, 0x00FFFF, "You have been unfrozen!");
    return true;
}
CMD:goto(playerid, params[])
{
    if(admin[playerid] < 1) return SendClientMessage(playerid, COLOR_RED, "Your not an admin with right lvl.");
    new iPlayer;
    if(sscanf(params, "i", iPlayer)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /goto [Player ID]");
    if(!IsPlayerConnected(iPlayer)) return SendClientMessage(playerid, 0xFF0000FF, "Player is not connected.");

    new Float:P[3];
    GetPlayerPos(iPlayer, P[0], P[1], P[2]);
    SetPlayerPos(playerid, P[0]+1, P[1]+1, P[2]);
    SendClientMessage(playerid, 0xFF0000FF, "You teleported to this player.");
    return true;
}
CMD:get(playerid,params[])
{
    if(admin[playerid] < 2) return SendClientMessage(playerid, COLOR_RED, "Your not an admin with right lvl.");
    new targetid, Float:x, Float:y, Float:z;
    if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /get [id]");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, "That player is not connected");
    GetPlayerPos(playerid, x, y, z);
    SetPlayerPos(targetid, x, y+0.5, z+0.5);
    return true;
}


I get 0 errors but server wont start!

'

I think it mysql file.. BUT I HAVE IT ALL PLACES!


In plugins


In Includes


In Server.cfg

I also have pwn and amx file.

Reply
#2

Instead of
Код:
gamemode0 rg
Give
Код:
gamemode0 rg 1
If it won't work, try instead of 'rg' gamemode, give another one, e.g. one of default (for example 'barron').
Reply
#3

Still don't work. Thanks for trying!

Anny one other?
Reply
#4

RG.amx maybe got a proplem.
Reply
#5

@up, if RG.amx has got a problem, it shouldn't compile from .pwn 2 .amx
But.. maybe.. However, there also can be problem from the plugin side.
Reply
#6

Ths happened to e the .pwn compiled but when I try to run it i got the same proplem but I removed fs and tried agin and worked
Reply
#7

I have made it in a new pwn and amx, Still the same D:
Thx for try!
EDIT: Yes, RP script.
Reply
#8

try remove thiS FSes??
Reply
#9

I FIXED IT <3 ! DDDDDD
Reply
#10

what was the problem ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)