[HELP]admin script
#1

hi, i need help with my admin script... there are no errors but when i try to do a command like "giveweapon", "akill","announce" it says "Unkown Command" why?
b.t.w: the register/login/logout/password works great! but those command doesn't work..
code:
PHP код:
#include <a_samp>
#include <dini>
#include <dutils>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define COLOUR_GREEN           0x33AA33AA
#define COLOUR_RED             0xAA3333AA
#define COLOUR_YELLOW          0xFFFF00AA
#define COLOUR_LIGHTBLUE       0x33CCFFAA
#define COLOUR_ORANGE          0xFF9900AA
#define PlayerFile            "GodFuckerRegisterSystem/Users/%s.ini"
#define SettingFile            "GodFuckerRegisterSystem/Settings/MainSettings.ini"
#define CommandFile            "GodFuckerRegisterSystem/Settings/Commands.ini"
enum PLAYER_MAIN {
    
PLAYER_NAME[MAX_PLAYER_NAME],
    
PLAYER_IP[16],
    
PLAYER_REGGED,
    
PLAYER_PASS,
    
PLAYER_LOGGED,
    
PLAYER_LEVEL,
    
PLAYER_WIRED,
    
PLAYER_JAILED
}
enum SETTINGS_MAIN {
    
POCKET_MONEY,
    
JAIL_COMMANDS,
    
ANNOUNCE_SECONDS,
    
PASS_MIN,
    
PASS_MAX
}
enum COMMANDS_MAIN {
    
AKILL,
    
ANNOUNCE,
    
ARMOURALL,
    
BAN,
    
CARHP,
    
EXPLODE,
    
FLIP,
    GOTO,
    
GETHERE,
    
GIVEARMOUR,
    
GIVEHEALTH,
    
GIVEWEAPON,
    
GOD,
    
HEALALL,
    
IMITATE,
    
IP,
    
KICK,
    
MAXAMMO,
    
PING,
    
SETLEVEL,
    
SETWANTED,
    
TBAN,
    
TIME,
    
WEATHER
}
new 
gCommands[COMMANDS_MAIN];
new 
gSettings[SETTINGS_MAIN];
new 
gPlayerInfo[MAX_PLAYERS][PLAYER_MAIN];
public 
OnFilterScriptInit()
{
     print(
"\n****************************************");
    print(
"* Admin FilterScript By Omer5198 *");
    print(
"****************************************\n");
        if(!
fexist(SettingFile))
    {
        
dini_Create(SettingFile);
        
dini_IntSet(SettingFile"PocketMoney"3000);
        
dini_IntSet(SettingFile"JailCommands"0);
        
dini_IntSet(SettingFile"AnnounceSeconds"3);
        
dini_IntSet(SettingFile"PassMin"3);
        
dini_IntSet(SettingFile"PassMax"15);
    }
    
gSettings[POCKET_MONEY]         = dini_Int(SettingFile"PocketMoney");
    
gSettings[JAIL_COMMANDS]         = dini_Int(SettingFile"JailCommands");
    
gSettings[ANNOUNCE_SECONDS]             = dini_Int(SettingFile"AnnounceSeconds");
    
gSettings[PASS_MIN]             = dini_Int(SettingFile"PassMin");
    
gSettings[PASS_MAX]             = dini_Int(SettingFile"PassMax");
    if(!
fexist(CommandFile))
    {
        
dini_Create(CommandFile);
        
dini_IntSet(CommandFile"Akill"6);
        
dini_IntSet(CommandFile"Announce"5);
        
dini_IntSet(CommandFile"Armourall"3);
        
dini_IntSet(CommandFile"Ban"9);
        
dini_IntSet(CommandFile"Carhp"4);
        
dini_IntSet(CommandFile"Explode"5);
        
dini_IntSet(CommandFile"Goto"4);
        
dini_IntSet(CommandFile"Gethere"5);
        
dini_IntSet(CommandFile"Givearmour"6);
        
dini_IntSet(CommandFile"Givehealth"6);
        
dini_IntSet(CommandFile"Giveweapon"7);
        
dini_IntSet(CommandFile"God"10);
        
dini_IntSet(CommandFile"Healall"7);
        
dini_IntSet(CommandFile"Imitate"8);
        
dini_IntSet(CommandFile"Ip"2);
        
dini_IntSet(CommandFile"Kick"7);
        
dini_IntSet(CommandFile"Maxammo"8);
        
dini_IntSet(CommandFile"Ping"1);
        
dini_IntSet(CommandFile"Setlevel"10);
        
dini_IntSet(CommandFile"Setwanted"6);
        
dini_IntSet(CommandFile"Tban"9);
        
dini_IntSet(CommandFile"Time"3);
        
dini_IntSet(CommandFile"Weather"3);
        }
    
gCommands[AKILL]             = dini_Int(CommandFile"Akill");
    
gCommands[ANNOUNCE]                 = dini_Int(CommandFile"Announce");
    
gCommands[ARMOURALL]             = dini_Int(CommandFile"Armourall");
    
gCommands[BAN]                 = dini_Int(CommandFile"Ban");
    
gCommands[CARHP]             = dini_Int(CommandFile"Carhp");
    
gCommands[EXPLODE]             = dini_Int(CommandFile"Explode");
    
gCommands[GOTO]             = dini_Int(CommandFile"Goto");
    
gCommands[GETHERE]             = dini_Int(CommandFile"Gethere");
    
gCommands[GIVEARMOUR]             = dini_Int(CommandFile"Givearmour");
    
gCommands[GIVEHEALTH]             = dini_Int(CommandFile"Givehealth");
    
gCommands[GIVEWEAPON]             = dini_Int(CommandFile"Giveweapon");
    
gCommands[GOD]                 = dini_Int(CommandFile"God");
    
gCommands[HEALALL]             = dini_Int(CommandFile"Healall");
    
gCommands[IMITATE]             = dini_Int(CommandFile"Imitate");
    
gCommands[IP]                 = dini_Int(CommandFile"Ip");
    
gCommands[KICK]             = dini_Int(CommandFile"Kick");
    
gCommands[MAXAMMO]             = dini_Int(CommandFile"Maxammo");
    
gCommands[SETLEVEL]             = dini_Int(CommandFile"Setlevel");
    
gCommands[SETWANTED]             = dini_Int(CommandFile"Setwanted");
    
gCommands[TBAN]             = dini_Int(CommandFile"Tban");
    
gCommands[TIME]             = dini_Int(CommandFile"Time");
    
gCommands[WEATHER]             = dini_Int(CommandFile"Weather");
     return 
1;
}
    
#endif
    
public OnPlayerConnect(playerid)
{
     new 
file[100],Name[MAX_PLAYER_NAME],Ip[16];
        
GetPlayerName(playerid,Name,sizeof(Name));
        
GetPlayerIp(playerid,Ip,sizeof(Ip));
        
format(file,sizeof(file),PlayerFile,Name);
    if(!
dini_Exists(file))
        {
         
dini_Create(file);
         
dini_Set(file,"Name",Name);
         
dini_Set(file,"Ip",Ip);
         
dini_IntSet(file,"Registered",-1);
         
dini_IntSet(file,"Password",0);
         
dini_IntSet(file,"Level",0);
         
dini_IntSet(file,"Wired",0);
         
dini_IntSet(file,"Jailed",0);
         
dini_IntSet(file,"Opened Gate",0);
         
SendClientMessage(playerid,COLOUR_ORANGE,"Your username is not recognized on this server. Please /register to continue.");
    }
    
strcat(gPlayerInfo[playerid][PLAYER_NAME],            dini_Get(file,"Name"));
    
strcat(gPlayerInfo[playerid][PLAYER_IP],            dini_Get(file,"Ip"));
    
gPlayerInfo[playerid][PLAYER_REGGED]                   = dini_Int(file,"Registered");
    
gPlayerInfo[playerid][PLAYER_PASS]                            = dini_Int(file,"Password");
    
gPlayerInfo[playerid][PLAYER_LEVEL]                   = dini_Int(file,"Level");
    
gPlayerInfo[playerid][PLAYER_WIRED]                           = dini_Int(file,"Wired");
    
gPlayerInfo[playerid][PLAYER_JAILED]                   = dini_Int(file,"Jailed");
    if(
gPlayerInfo[playerid][PLAYER_REGGED] == 0)                     SendClientMessage(playerid,COLOUR_ORANGE,"You're username is recognised on this server, but you have not registered. Please /register to continue.");
    else if(
gPlayerInfo[playerid][PLAYER_REGGED] == 1)              SendClientMessage(playerid,COLOUR_ORANGE,"You're username is recognised on this server. Please /login to continue.");
        
gPlayerInfo[playerid][PLAYER_REGGED]                          = 0;
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    new 
file[100];
        
format(file,sizeof(file),PlayerFile,gPlayerInfo[playerid][PLAYER_NAME]);
    
dini_Set(file,"Name",gPlayerInfo[playerid][PLAYER_NAME]);
    
dini_Set(file,"Ip",gPlayerInfo[playerid][PLAYER_IP]);
    
dini_IntSet(file,"Registered",gPlayerInfo[playerid][PLAYER_REGGED]);
    
dini_IntSet(file,"Password",gPlayerInfo[playerid][PLAYER_PASS]);
    
dini_IntSet(file,"Level",gPlayerInfo[playerid][PLAYER_LEVEL]);
    
dini_IntSet(file,"Wired",gPlayerInfo[playerid][PLAYER_WIRED]);
    
dini_IntSet(file,"Jailed",gPlayerInfo[playerid][PLAYER_JAILED]);
    
gPlayerInfo[playerid][PLAYER_NAME]   = 0;
    
gPlayerInfo[playerid][PLAYER_IP]     = 0;
    
gPlayerInfo[playerid][PLAYER_REGGED] = 0;
    
gPlayerInfo[playerid][PLAYER_LOGGED] = 0;
    
gPlayerInfo[playerid][PLAYER_PASS]   = 0;
    
gPlayerInfo[playerid][PLAYER_LEVEL]  = 0;
    
gPlayerInfo[playerid][PLAYER_WIRED]  = 0;
    
gPlayerInfo[playerid][PLAYER_JAILED] = 0;
           return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    
dcmd(register8cmdtext);
    
dcmd(login5cmdtext);
    
dcmd(logout6cmdtext);
    
dcmd(password8cmdtext);
    return 
0;
}
dcmd_giveweapon(playeridparams[])
{
    if(
gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[GIVEWEAPON])
    {
        new 
string[100];
        
format(stringsizeof(string), "You must be administrator level %d to use that command!"gCommands[AKILL]);
        return 
SendClientMessage(playeridCOLOUR_ORANGEstring);
    }
    else if(!
strlen(params))
        return 
SendClientMessage(playeridCOLOUR_ORANGE"USAGE: /giveweapon [id | name]");
    else
    {
    new 
id = (isNumeric(params)) ? strval(params) : GetPlayerId(params);
    if(
IsPlayerConnected(id) && id != playerid)
    {
        
GivePlayerWeapon(id3899999);
        new 
string[128];
        
format(stringsizeof(string), "You have been admin-killed by administrator \'%s\'."gPlayerInfo[playerid][PLAYER_NAME]);
        
SendClientMessage(idCOLOUR_ORANGEstring);
        
format(stringsizeof(string), "You have successfully admin-killed player \'%s\'."gPlayerInfo[id][PLAYER_NAME]);
        return 
SendClientMessage(playeridCOLOUR_LIGHTBLUEstring);
    }
    else
        return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You can not admin-kill yourself or a disconnected player.");
    }
}
dcmd_register(playeridparams[])
{
    if(
gPlayerInfo[playerid][PLAYER_REGGED] == 1)
    return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You have already registered!");
    else if(!
params[0])
    return 
SendClientMessage(playeridCOLOUR_ORANGE"USAGE: /register [password]");
    else if(
strlen(params) < gSettings[PASS_MIN] || strlen(params) > gSettings[PASS_MAX])
    {
    new 
string[128];
        
format(stringsizeof(string), "ERROR: Password must be between 3 and 15 characters long!"gSettings[PASS_MIN], gSettings[PASS_MAX]);
    return 
SendClientMessage(playeridCOLOUR_ORANGEstring);
    }
    else
    {
    new 
password num_hash(params);
    
gPlayerInfo[playerid][PLAYER_PASS] = password;
    
gPlayerInfo[playerid][PLAYER_REGGED] = 1;
        
gPlayerInfo[playerid][PLAYER_LOGGED] = 1;
    
GetPlayerIp(playeridgPlayerInfo[playerid][PLAYER_IP], 16);
    new 
string[128]; format(stringsizeof(string), "You have successfully registered your account with the password \'%s\'. You have been automatically logged in."params);
    return 
SendClientMessage(playeridCOLOUR_LIGHTBLUEstring);
    }
}
dcmd_login(playeridparams[])
{
    if(
gPlayerInfo[playerid][PLAYER_REGGED] != 1)
    return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You must register first to do that! Use /register [password] to register and login.");
    else if(
gPlayerInfo[playerid][PLAYER_LOGGED] == 1)
    return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You are already logged-in.");
    else if(!
params[0])
    return 
SendClientMessage(playeridCOLOUR_ORANGE"USAGE: /login [password]");
    else
    {
    new 
password num_hash(params);
    if(
gPlayerInfo[playerid][PLAYER_PASS] == password)
    {
        
gPlayerInfo[playerid][PLAYER_LOGGED] = 1;
            
GetPlayerIp(playeridgPlayerInfo[playerid][PLAYER_IP], 16);
        return 
SendClientMessage(playeridCOLOUR_LIGHTBLUE"You have successfully logged in to your account.");
    }
    else
        return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: Incorrect password.");
    }
}
dcmd_logout(playeridparams[])
{
#pragma unused params
    
if(gPlayerInfo[playerid][PLAYER_REGGED] != 1)
    return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You must register first to do that! Use /register [password] to register.");
    else if(
gPlayerInfo[playerid][PLAYER_LOGGED] == 0)
    return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You are already logged-out.");
    else
    {
    
gPlayerInfo[playerid][PLAYER_LOGGED] = 0;
    return 
SendClientMessage(playeridCOLOUR_LIGHTBLUE"You have successfully logged out of your account.");
    }
}
dcmd_password(playeridparams[])
{
    if(
gPlayerInfo[playerid][PLAYER_REGGED] != 1)
        return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You must register first to do that! Use /register [password] to register and login.");
    else if(
gPlayerInfo[playerid][PLAYER_LOGGED] == 0)
    return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You must be logged-in to do that! Use /login [password] to login.");
    else
    {
    new 
tmp[255],
        
tmp2[255],
        
index;
    
tmp strtok(paramsindex);
    if(!
strlen(tmp))
            return 
SendClientMessage(playeridCOLOUR_ORANGE"USAGE: /password [password] [new password]");
    
tmp2 strtok(paramsindex);
    if(!
strlen(tmp2))
        return 
SendClientMessage(playeridCOLOUR_ORANGE"USAGE: /password [password] [new password]");
        new 
oldpassword num_hash(tmp), newpassword num_hash(tmp2);
    if(
gPlayerInfo[playerid][PLAYER_PASS] == oldpassword)
    {
        if(
oldpassword == newpassword)
            return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: Your old password can not be the same as your new password.");
            else if(
strlen(tmp2) < gSettings[PASS_MIN] || strlen(tmp2) > gSettings[PASS_MAX])
            {
                new 
string[100]; format(stringsizeof(string), "ERROR: Your new password must be between %d and %d characters long!"gSettings[PASS_MIN], gSettings[PASS_MAX]);
                return 
SendClientMessage(playeridCOLOUR_ORANGEstring);
            }
        
gPlayerInfo[playerid][PLAYER_PASS] = newpassword;
        new 
string[128]; format(stringsizeof(string), "You have successfully changed your password from \'%s\' to \'%s\'."tmptmp2);
        return 
SendClientMessage(playeridCOLOUR_LIGHTBLUEstring);
    }
    else
        return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: Incorrect password.");
    }
}
dcmd_akill(playeridparams[])
{
    if(
gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[AKILL])
    {
        new 
string[100];
        
format(stringsizeof(string), "You must be administrator level %d to use that command!"gCommands[AKILL]);
        return 
SendClientMessage(playeridCOLOUR_ORANGEstring);
    }
    else if(!
strlen(params))
        return 
SendClientMessage(playeridCOLOUR_ORANGE"USAGE: /akill [id | name]");
    else
    {
    new 
id = (isNumeric(params)) ? strval(params) : GetPlayerId(params);
    if(
IsPlayerConnected(id) && id != playerid)
    {
        
SetPlayerHealth(id0.0);
        new 
string[128];
        
format(stringsizeof(string), "You have been admin-killed by administrator \'%s\'."gPlayerInfo[playerid][PLAYER_NAME]);
        
SendClientMessage(idCOLOUR_ORANGEstring);
        
format(stringsizeof(string), "You have successfully admin-killed player \'%s\'."gPlayerInfo[id][PLAYER_NAME]);
        return 
SendClientMessage(playeridCOLOUR_LIGHTBLUEstring);
    }
    else
        return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You can not admin-kill yourself or a disconnected player.");
    }
}
dcmd_announce(playeridparams[])
{
    if(
gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[ANNOUNCE])
    {
        new 
string[100];
        
format(stringsizeof(string), "You must be administrator level %d to use that command!"gCommands[ANNOUNCE]);
        return 
SendClientMessage(playeridCOLOUR_ORANGEstring);
    }
    else if(!
strlen(params))
        return 
SendClientMessage(playeridCOLOUR_ORANGE"USAGE: /announce [message]");
    else
        return 
GameTextForAll(paramsgSettings[ANNOUNCE_SECONDS] * 10003);

Reply
#2

u get any errors?
Reply
#3

sorry for double post

Quote:
Originally Posted by omer5198
Посмотреть сообщение
hi, i need help with my admin script... there are no errors but when i try to do a command like "giveweapon", "akill","announce" it says "Unkown Command" why?
b.t.w: the register/login/logout/password works great! but those command doesn't work..
code:
PHP код:
#include <a_samp>
#include <dini>
#include <dutils>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define COLOUR_GREEN           0x33AA33AA
#define COLOUR_RED             0xAA3333AA
#define COLOUR_YELLOW          0xFFFF00AA
#define COLOUR_LIGHTBLUE       0x33CCFFAA
#define COLOUR_ORANGE          0xFF9900AA
#define PlayerFile            "GodFuckerRegisterSystem/Users/%s.ini"
#define SettingFile            "GodFuckerRegisterSystem/Settings/MainSettings.ini"
#define CommandFile            "GodFuckerRegisterSystem/Settings/Commands.ini"
enum PLAYER_MAIN {
    
PLAYER_NAME[MAX_PLAYER_NAME],
    
PLAYER_IP[16],
    
PLAYER_REGGED,
    
PLAYER_PASS,
    
PLAYER_LOGGED,
    
PLAYER_LEVEL,
    
PLAYER_WIRED,
    
PLAYER_JAILED
}
enum SETTINGS_MAIN {
    
POCKET_MONEY,
    
JAIL_COMMANDS,
    
ANNOUNCE_SECONDS,
    
PASS_MIN,
    
PASS_MAX
}
enum COMMANDS_MAIN {
    
AKILL,
    
ANNOUNCE,
    
ARMOURALL,
    
BAN,
    
CARHP,
    
EXPLODE,
    
FLIP,
    GOTO,
    
GETHERE,
    
GIVEARMOUR,
    
GIVEHEALTH,
    
GIVEWEAPON,
    
GOD,
    
HEALALL,
    
IMITATE,
    
IP,
    
KICK,
    
MAXAMMO,
    
PING,
    
SETLEVEL,
    
SETWANTED,
    
TBAN,
    
TIME,
    
WEATHER
}
new 
gCommands[COMMANDS_MAIN];
new 
gSettings[SETTINGS_MAIN];
new 
gPlayerInfo[MAX_PLAYERS][PLAYER_MAIN];
public 
OnFilterScriptInit()
{
     print(
"\n****************************************");
    print(
"* Admin FilterScript By Omer5198 *");
    print(
"****************************************\n");
        if(!
fexist(SettingFile))
    {
        
dini_Create(SettingFile);
        
dini_IntSet(SettingFile"PocketMoney"3000);
        
dini_IntSet(SettingFile"JailCommands"0);
        
dini_IntSet(SettingFile"AnnounceSeconds"3);
        
dini_IntSet(SettingFile"PassMin"3);
        
dini_IntSet(SettingFile"PassMax"15);
    }
    
gSettings[POCKET_MONEY]         = dini_Int(SettingFile"PocketMoney");
    
gSettings[JAIL_COMMANDS]         = dini_Int(SettingFile"JailCommands");
    
gSettings[ANNOUNCE_SECONDS]             = dini_Int(SettingFile"AnnounceSeconds");
    
gSettings[PASS_MIN]             = dini_Int(SettingFile"PassMin");
    
gSettings[PASS_MAX]             = dini_Int(SettingFile"PassMax");
    if(!
fexist(CommandFile))
    {
        
dini_Create(CommandFile);
        
dini_IntSet(CommandFile"Akill"6);
        
dini_IntSet(CommandFile"Announce"5);
        
dini_IntSet(CommandFile"Armourall"3);
        
dini_IntSet(CommandFile"Ban"9);
        
dini_IntSet(CommandFile"Carhp"4);
        
dini_IntSet(CommandFile"Explode"5);
        
dini_IntSet(CommandFile"Goto"4);
        
dini_IntSet(CommandFile"Gethere"5);
        
dini_IntSet(CommandFile"Givearmour"6);
        
dini_IntSet(CommandFile"Givehealth"6);
        
dini_IntSet(CommandFile"Giveweapon"7);
        
dini_IntSet(CommandFile"God"10);
        
dini_IntSet(CommandFile"Healall"7);
        
dini_IntSet(CommandFile"Imitate"8);
        
dini_IntSet(CommandFile"Ip"2);
        
dini_IntSet(CommandFile"Kick"7);
        
dini_IntSet(CommandFile"Maxammo"8);
        
dini_IntSet(CommandFile"Ping"1);
        
dini_IntSet(CommandFile"Setlevel"10);
        
dini_IntSet(CommandFile"Setwanted"6);
        
dini_IntSet(CommandFile"Tban"9);
        
dini_IntSet(CommandFile"Time"3);
        
dini_IntSet(CommandFile"Weather"3);
        }
    
gCommands[AKILL]             = dini_Int(CommandFile"Akill");
    
gCommands[ANNOUNCE]                 = dini_Int(CommandFile"Announce");
    
gCommands[ARMOURALL]             = dini_Int(CommandFile"Armourall");
    
gCommands[BAN]                 = dini_Int(CommandFile"Ban");
    
gCommands[CARHP]             = dini_Int(CommandFile"Carhp");
    
gCommands[EXPLODE]             = dini_Int(CommandFile"Explode");
    
gCommands[GOTO]             = dini_Int(CommandFile"Goto");
    
gCommands[GETHERE]             = dini_Int(CommandFile"Gethere");
    
gCommands[GIVEARMOUR]             = dini_Int(CommandFile"Givearmour");
    
gCommands[GIVEHEALTH]             = dini_Int(CommandFile"Givehealth");
    
gCommands[GIVEWEAPON]             = dini_Int(CommandFile"Giveweapon");
    
gCommands[GOD]                 = dini_Int(CommandFile"God");
    
gCommands[HEALALL]             = dini_Int(CommandFile"Healall");
    
gCommands[IMITATE]             = dini_Int(CommandFile"Imitate");
    
gCommands[IP]                 = dini_Int(CommandFile"Ip");
    
gCommands[KICK]             = dini_Int(CommandFile"Kick");
    
gCommands[MAXAMMO]             = dini_Int(CommandFile"Maxammo");
    
gCommands[SETLEVEL]             = dini_Int(CommandFile"Setlevel");
    
gCommands[SETWANTED]             = dini_Int(CommandFile"Setwanted");
    
gCommands[TBAN]             = dini_Int(CommandFile"Tban");
    
gCommands[TIME]             = dini_Int(CommandFile"Time");
    
gCommands[WEATHER]             = dini_Int(CommandFile"Weather");
     return 
1;
}
    
#endif
    
public OnPlayerConnect(playerid)
{
     new 
file[100],Name[MAX_PLAYER_NAME],Ip[16];
        
GetPlayerName(playerid,Name,sizeof(Name));
        
GetPlayerIp(playerid,Ip,sizeof(Ip));
        
format(file,sizeof(file),PlayerFile,Name);
    if(!
dini_Exists(file))
        {
         
dini_Create(file);
         
dini_Set(file,"Name",Name);
         
dini_Set(file,"Ip",Ip);
         
dini_IntSet(file,"Registered",-1);
         
dini_IntSet(file,"Password",0);
         
dini_IntSet(file,"Level",0);
         
dini_IntSet(file,"Wired",0);
         
dini_IntSet(file,"Jailed",0);
         
dini_IntSet(file,"Opened Gate",0);
         
SendClientMessage(playerid,COLOUR_ORANGE,"Your username is not recognized on this server. Please /register to continue.");
    }
    
strcat(gPlayerInfo[playerid][PLAYER_NAME],            dini_Get(file,"Name"));
    
strcat(gPlayerInfo[playerid][PLAYER_IP],            dini_Get(file,"Ip"));
    
gPlayerInfo[playerid][PLAYER_REGGED]                   = dini_Int(file,"Registered");
    
gPlayerInfo[playerid][PLAYER_PASS]                            = dini_Int(file,"Password");
    
gPlayerInfo[playerid][PLAYER_LEVEL]                   = dini_Int(file,"Level");
    
gPlayerInfo[playerid][PLAYER_WIRED]                           = dini_Int(file,"Wired");
    
gPlayerInfo[playerid][PLAYER_JAILED]                   = dini_Int(file,"Jailed");
    if(
gPlayerInfo[playerid][PLAYER_REGGED] == 0)                     SendClientMessage(playerid,COLOUR_ORANGE,"You're username is recognised on this server, but you have not registered. Please /register to continue.");
    else if(
gPlayerInfo[playerid][PLAYER_REGGED] == 1)              SendClientMessage(playerid,COLOUR_ORANGE,"You're username is recognised on this server. Please /login to continue.");
        
gPlayerInfo[playerid][PLAYER_REGGED]                          = 0;
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    new 
file[100];
        
format(file,sizeof(file),PlayerFile,gPlayerInfo[playerid][PLAYER_NAME]);
    
dini_Set(file,"Name",gPlayerInfo[playerid][PLAYER_NAME]);
    
dini_Set(file,"Ip",gPlayerInfo[playerid][PLAYER_IP]);
    
dini_IntSet(file,"Registered",gPlayerInfo[playerid][PLAYER_REGGED]);
    
dini_IntSet(file,"Password",gPlayerInfo[playerid][PLAYER_PASS]);
    
dini_IntSet(file,"Level",gPlayerInfo[playerid][PLAYER_LEVEL]);
    
dini_IntSet(file,"Wired",gPlayerInfo[playerid][PLAYER_WIRED]);
    
dini_IntSet(file,"Jailed",gPlayerInfo[playerid][PLAYER_JAILED]);
    
gPlayerInfo[playerid][PLAYER_NAME]   = 0;
    
gPlayerInfo[playerid][PLAYER_IP]     = 0;
    
gPlayerInfo[playerid][PLAYER_REGGED] = 0;
    
gPlayerInfo[playerid][PLAYER_LOGGED] = 0;
    
gPlayerInfo[playerid][PLAYER_PASS]   = 0;
    
gPlayerInfo[playerid][PLAYER_LEVEL]  = 0;
    
gPlayerInfo[playerid][PLAYER_WIRED]  = 0;
    
gPlayerInfo[playerid][PLAYER_JAILED] = 0;
           return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    
dcmd(register8cmdtext);
    
dcmd(login5cmdtext);
    
dcmd(logout6cmdtext);
    
dcmd(password8cmdtext);
    return 
0;
}
dcmd_giveweapon(playeridparams[])
{
    if(
gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[GIVEWEAPON])
    {
        new 
string[100];
        
format(stringsizeof(string), "You must be administrator level %d to use that command!"gCommands[AKILL]);
        return 
SendClientMessage(playeridCOLOUR_ORANGEstring);
    }
    else if(!
strlen(params))
        return 
SendClientMessage(playeridCOLOUR_ORANGE"USAGE: /giveweapon [id | name]");
    else
    {
    new 
id = (isNumeric(params)) ? strval(params) : GetPlayerId(params);
    if(
IsPlayerConnected(id) && id != playerid)
    {
        
GivePlayerWeapon(id3899999);
        new 
string[128];
        
format(stringsizeof(string), "You have been admin-killed by administrator \'%s\'."gPlayerInfo[playerid][PLAYER_NAME]);
        
SendClientMessage(idCOLOUR_ORANGEstring);
        
format(stringsizeof(string), "You have successfully admin-killed player \'%s\'."gPlayerInfo[id][PLAYER_NAME]);
        return 
SendClientMessage(playeridCOLOUR_LIGHTBLUEstring);
    }
    else
        return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You can not admin-kill yourself or a disconnected player.");
    }
}
dcmd_register(playeridparams[])
{
    if(
gPlayerInfo[playerid][PLAYER_REGGED] == 1)
    return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You have already registered!");
    else if(!
params[0])
    return 
SendClientMessage(playeridCOLOUR_ORANGE"USAGE: /register [password]");
    else if(
strlen(params) < gSettings[PASS_MIN] || strlen(params) > gSettings[PASS_MAX])
    {
    new 
string[128];
        
format(stringsizeof(string), "ERROR: Password must be between 3 and 15 characters long!"gSettings[PASS_MIN], gSettings[PASS_MAX]);
    return 
SendClientMessage(playeridCOLOUR_ORANGEstring);
    }
    else
    {
    new 
password num_hash(params);
    
gPlayerInfo[playerid][PLAYER_PASS] = password;
    
gPlayerInfo[playerid][PLAYER_REGGED] = 1;
        
gPlayerInfo[playerid][PLAYER_LOGGED] = 1;
    
GetPlayerIp(playeridgPlayerInfo[playerid][PLAYER_IP], 16);
    new 
string[128]; format(stringsizeof(string), "You have successfully registered your account with the password \'%s\'. You have been automatically logged in."params);
    return 
SendClientMessage(playeridCOLOUR_LIGHTBLUEstring);
    }
}
dcmd_login(playeridparams[])
{
    if(
gPlayerInfo[playerid][PLAYER_REGGED] != 1)
    return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You must register first to do that! Use /register [password] to register and login.");
    else if(
gPlayerInfo[playerid][PLAYER_LOGGED] == 1)
    return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You are already logged-in.");
    else if(!
params[0])
    return 
SendClientMessage(playeridCOLOUR_ORANGE"USAGE: /login [password]");
    else
    {
    new 
password num_hash(params);
    if(
gPlayerInfo[playerid][PLAYER_PASS] == password)
    {
        
gPlayerInfo[playerid][PLAYER_LOGGED] = 1;
            
GetPlayerIp(playeridgPlayerInfo[playerid][PLAYER_IP], 16);
        return 
SendClientMessage(playeridCOLOUR_LIGHTBLUE"You have successfully logged in to your account.");
    }
    else
        return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: Incorrect password.");
    }
}
dcmd_logout(playeridparams[])
{
#pragma unused params
    
if(gPlayerInfo[playerid][PLAYER_REGGED] != 1)
    return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You must register first to do that! Use /register [password] to register.");
    else if(
gPlayerInfo[playerid][PLAYER_LOGGED] == 0)
    return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You are already logged-out.");
    else
    {
    
gPlayerInfo[playerid][PLAYER_LOGGED] = 0;
    return 
SendClientMessage(playeridCOLOUR_LIGHTBLUE"You have successfully logged out of your account.");
    }
}
dcmd_password(playeridparams[])
{
    if(
gPlayerInfo[playerid][PLAYER_REGGED] != 1)
        return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You must register first to do that! Use /register [password] to register and login.");
    else if(
gPlayerInfo[playerid][PLAYER_LOGGED] == 0)
    return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You must be logged-in to do that! Use /login [password] to login.");
    else
    {
    new 
tmp[255],
        
tmp2[255],
        
index;
    
tmp strtok(paramsindex);
    if(!
strlen(tmp))
            return 
SendClientMessage(playeridCOLOUR_ORANGE"USAGE: /password [password] [new password]");
    
tmp2 strtok(paramsindex);
    if(!
strlen(tmp2))
        return 
SendClientMessage(playeridCOLOUR_ORANGE"USAGE: /password [password] [new password]");
        new 
oldpassword num_hash(tmp), newpassword num_hash(tmp2);
    if(
gPlayerInfo[playerid][PLAYER_PASS] == oldpassword)
    {
        if(
oldpassword == newpassword)
            return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: Your old password can not be the same as your new password.");
            else if(
strlen(tmp2) < gSettings[PASS_MIN] || strlen(tmp2) > gSettings[PASS_MAX])
            {
                new 
string[100]; format(stringsizeof(string), "ERROR: Your new password must be between %d and %d characters long!"gSettings[PASS_MIN], gSettings[PASS_MAX]);
                return 
SendClientMessage(playeridCOLOUR_ORANGEstring);
            }
        
gPlayerInfo[playerid][PLAYER_PASS] = newpassword;
        new 
string[128]; format(stringsizeof(string), "You have successfully changed your password from \'%s\' to \'%s\'."tmptmp2);
        return 
SendClientMessage(playeridCOLOUR_LIGHTBLUEstring);
    }
    else
        return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: Incorrect password.");
    }
}
dcmd_akill(playeridparams[])
{
    if(
gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[AKILL])
    {
        new 
string[100];
        
format(stringsizeof(string), "You must be administrator level %d to use that command!"gCommands[AKILL]);
        return 
SendClientMessage(playeridCOLOUR_ORANGEstring);
    }
    else if(!
strlen(params))
        return 
SendClientMessage(playeridCOLOUR_ORANGE"USAGE: /akill [id | name]");
    else
    {
    new 
id = (isNumeric(params)) ? strval(params) : GetPlayerId(params);
    if(
IsPlayerConnected(id) && id != playerid)
    {
        
SetPlayerHealth(id0.0);
        new 
string[128];
        
format(stringsizeof(string), "You have been admin-killed by administrator \'%s\'."gPlayerInfo[playerid][PLAYER_NAME]);
        
SendClientMessage(idCOLOUR_ORANGEstring);
        
format(stringsizeof(string), "You have successfully admin-killed player \'%s\'."gPlayerInfo[id][PLAYER_NAME]);
        return 
SendClientMessage(playeridCOLOUR_LIGHTBLUEstring);
    }
    else
        return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You can not admin-kill yourself or a disconnected player.");
    }
}
dcmd_announce(playeridparams[])
{
    if(
gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[ANNOUNCE])
    {
        new 
string[100];
        
format(stringsizeof(string), "You must be administrator level %d to use that command!"gCommands[ANNOUNCE]);
        return 
SendClientMessage(playeridCOLOUR_ORANGEstring);
    }
    else if(!
strlen(params))
        return 
SendClientMessage(playeridCOLOUR_ORANGE"USAGE: /announce [message]");
    else
        return 
GameTextForAll(paramsgSettings[ANNOUNCE_SECONDS] * 10003);

Under onplayercommandtext it will show
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(register, 8, cmdtext);
    dcmd(login, 5, cmdtext);
    dcmd(logout, 6, cmdtext);
    dcmd(password, 8, cmdtext);
    return 0;
}
so you need to add
dcmd(akill,5,cmdtext);

SCRIPT--
pawn Код:
dcmd(register, 8, cmdtext);
    dcmd(login, 5, cmdtext);
    dcmd(logout, 6, cmdtext);
    dcmd(password, 8, cmdtext);
    dcmd(akill,5,cmdtext);
COPPY THIS!!!!
Reply
#4

lmfao ^^

OT: i recommend ZCMD because it does not need defining in OnPlayerCommandText.

Link to ZCMD: https://sampforum.blast.hk/showthread.php?tid=91354

Converted to ZCMD:

pawn Код:
#include <a_samp>
#include <dini>
#include <dutils>
#include <zcmd>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
#define COLOUR_GREEN           0x33AA33AA
#define COLOUR_RED             0xAA3333AA
#define COLOUR_YELLOW          0xFFFF00AA
#define COLOUR_LIGHTBLUE       0x33CCFFAA
#define COLOUR_ORANGE          0xFF9900AA

#define PlayerFile            "GodFuckerRegisterSystem/Users/%s.ini"
#define SettingFile            "GodFuckerRegisterSystem/Settings/MainSettings.ini"
#define CommandFile            "GodFuckerRegisterSystem/Settings/Commands.ini"

enum PLAYER_MAIN {
    PLAYER_NAME[MAX_PLAYER_NAME],
    PLAYER_IP[16],
    PLAYER_REGGED,
    PLAYER_PASS,
    PLAYER_LOGGED,
    PLAYER_LEVEL,
    PLAYER_WIRED,
    PLAYER_JAILED
}
enum SETTINGS_MAIN {
    POCKET_MONEY,
    JAIL_COMMANDS,
    ANNOUNCE_SECONDS,
    PASS_MIN,
    PASS_MAX
}
enum COMMANDS_MAIN {
    AKILL,
    ANNOUNCE,
    ARMOURALL,
    BAN,
    CARHP,
    EXPLODE,
    FLIP,
    GOTO,
    GETHERE,
    GIVEARMOUR,
    GIVEHEALTH,
    GIVEWEAPON,
    GOD,
    HEALALL,
    IMITATE,
    IP,
    KICK,
    MAXAMMO,
    PING,
    SETLEVEL,
    SETWANTED,
    TBAN,
    TIME,
    WEATHER
}

new gCommands[COMMANDS_MAIN];
new gSettings[SETTINGS_MAIN];
new gPlayerInfo[MAX_PLAYERS][PLAYER_MAIN];

public OnFilterScriptInit()
{
     print("\n****************************************");
    print("* Admin FilterScript By Omer5198 *");
    print("****************************************\n");

        if(!fexist(SettingFile))
    {
        dini_Create(SettingFile);
        dini_IntSet(SettingFile, "PocketMoney", 3000);
        dini_IntSet(SettingFile, "JailCommands", 0);
        dini_IntSet(SettingFile, "AnnounceSeconds", 3);
        dini_IntSet(SettingFile, "PassMin", 3);
        dini_IntSet(SettingFile, "PassMax", 15);
    }

    gSettings[POCKET_MONEY]         = dini_Int(SettingFile, "PocketMoney");
    gSettings[JAIL_COMMANDS]         = dini_Int(SettingFile, "JailCommands");
    gSettings[ANNOUNCE_SECONDS]             = dini_Int(SettingFile, "AnnounceSeconds");
    gSettings[PASS_MIN]             = dini_Int(SettingFile, "PassMin");
    gSettings[PASS_MAX]             = dini_Int(SettingFile, "PassMax");

    if(!fexist(CommandFile))
    {
        dini_Create(CommandFile);
        dini_IntSet(CommandFile, "Akill", 6);
        dini_IntSet(CommandFile, "Announce", 5);
        dini_IntSet(CommandFile, "Armourall", 3);
        dini_IntSet(CommandFile, "Ban", 9);
        dini_IntSet(CommandFile, "Carhp", 4);
        dini_IntSet(CommandFile, "Explode", 5);
        dini_IntSet(CommandFile, "Goto", 4);
        dini_IntSet(CommandFile, "Gethere", 5);
        dini_IntSet(CommandFile, "Givearmour", 6);
        dini_IntSet(CommandFile, "Givehealth", 6);
        dini_IntSet(CommandFile, "Giveweapon", 7);
        dini_IntSet(CommandFile, "God", 10);
        dini_IntSet(CommandFile, "Healall", 7);
        dini_IntSet(CommandFile, "Imitate", 8);
        dini_IntSet(CommandFile, "Ip", 2);
        dini_IntSet(CommandFile, "Kick", 7);
        dini_IntSet(CommandFile, "Maxammo", 8);
        dini_IntSet(CommandFile, "Ping", 1);
        dini_IntSet(CommandFile, "Setlevel", 10);
        dini_IntSet(CommandFile, "Setwanted", 6);
        dini_IntSet(CommandFile, "Tban", 9);
        dini_IntSet(CommandFile, "Time", 3);
        dini_IntSet(CommandFile, "Weather", 3);
        }

    gCommands[AKILL]             = dini_Int(CommandFile, "Akill");
    gCommands[ANNOUNCE]                 = dini_Int(CommandFile, "Announce");
    gCommands[ARMOURALL]             = dini_Int(CommandFile, "Armourall");
    gCommands[BAN]                 = dini_Int(CommandFile, "Ban");
    gCommands[CARHP]             = dini_Int(CommandFile, "Carhp");
    gCommands[EXPLODE]             = dini_Int(CommandFile, "Explode");
    gCommands[GOTO]             = dini_Int(CommandFile, "Goto");
    gCommands[GETHERE]             = dini_Int(CommandFile, "Gethere");
    gCommands[GIVEARMOUR]             = dini_Int(CommandFile, "Givearmour");
    gCommands[GIVEHEALTH]             = dini_Int(CommandFile, "Givehealth");
    gCommands[GIVEWEAPON]             = dini_Int(CommandFile, "Giveweapon");
    gCommands[GOD]                 = dini_Int(CommandFile, "God");
    gCommands[HEALALL]             = dini_Int(CommandFile, "Healall");
    gCommands[IMITATE]             = dini_Int(CommandFile, "Imitate");
    gCommands[IP]                 = dini_Int(CommandFile, "Ip");
    gCommands[KICK]             = dini_Int(CommandFile, "Kick");
    gCommands[MAXAMMO]             = dini_Int(CommandFile, "Maxammo");
    gCommands[SETLEVEL]             = dini_Int(CommandFile, "Setlevel");
    gCommands[SETWANTED]             = dini_Int(CommandFile, "Setwanted");
    gCommands[TBAN]             = dini_Int(CommandFile, "Tban");
    gCommands[TIME]             = dini_Int(CommandFile, "Time");
    gCommands[WEATHER]             = dini_Int(CommandFile, "Weather");

     return 1;
}
    #endif

    public OnPlayerConnect(playerid)
{
     new file[100],Name[MAX_PLAYER_NAME],Ip[16];
        GetPlayerName(playerid,Name,sizeof(Name));
        GetPlayerIp(playerid,Ip,sizeof(Ip));
        format(file,sizeof(file),PlayerFile,Name);

    if(!dini_Exists(file))
        {
         dini_Create(file);
         dini_Set(file,"Name",Name);
         dini_Set(file,"Ip",Ip);
         dini_IntSet(file,"Registered",-1);
         dini_IntSet(file,"Password",0);
         dini_IntSet(file,"Level",0);
         dini_IntSet(file,"Wired",0);
         dini_IntSet(file,"Jailed",0);
         dini_IntSet(file,"Opened Gate",0);
         SendClientMessage(playerid,COLOUR_ORANGE,"Your username is not recognized on this server. Please /register to continue.");
    }
    strcat(gPlayerInfo[playerid][PLAYER_NAME],            dini_Get(file,"Name"));
    strcat(gPlayerInfo[playerid][PLAYER_IP],            dini_Get(file,"Ip"));
    gPlayerInfo[playerid][PLAYER_REGGED]                   = dini_Int(file,"Registered");
    gPlayerInfo[playerid][PLAYER_PASS]                            = dini_Int(file,"Password");
    gPlayerInfo[playerid][PLAYER_LEVEL]                   = dini_Int(file,"Level");
    gPlayerInfo[playerid][PLAYER_WIRED]                           = dini_Int(file,"Wired");
    gPlayerInfo[playerid][PLAYER_JAILED]                   = dini_Int(file,"Jailed");
    if(gPlayerInfo[playerid][PLAYER_REGGED] == 0)                     SendClientMessage(playerid,COLOUR_ORANGE,"You're username is recognised on this server, but you have not registered. Please /register to continue.");
    else if(gPlayerInfo[playerid][PLAYER_REGGED] == 1)              SendClientMessage(playerid,COLOUR_ORANGE,"You're username is recognised on this server. Please /login to continue.");
        gPlayerInfo[playerid][PLAYER_REGGED]                          = 0;
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new file[100];
        format(file,sizeof(file),PlayerFile,gPlayerInfo[playerid][PLAYER_NAME]);
    dini_Set(file,"Name",gPlayerInfo[playerid][PLAYER_NAME]);
    dini_Set(file,"Ip",gPlayerInfo[playerid][PLAYER_IP]);
    dini_IntSet(file,"Registered",gPlayerInfo[playerid][PLAYER_REGGED]);
    dini_IntSet(file,"Password",gPlayerInfo[playerid][PLAYER_PASS]);
    dini_IntSet(file,"Level",gPlayerInfo[playerid][PLAYER_LEVEL]);
    dini_IntSet(file,"Wired",gPlayerInfo[playerid][PLAYER_WIRED]);
    dini_IntSet(file,"Jailed",gPlayerInfo[playerid][PLAYER_JAILED]);
    gPlayerInfo[playerid][PLAYER_NAME]   = 0;
    gPlayerInfo[playerid][PLAYER_IP]     = 0;
    gPlayerInfo[playerid][PLAYER_REGGED] = 0;
    gPlayerInfo[playerid][PLAYER_LOGGED] = 0;
    gPlayerInfo[playerid][PLAYER_PASS]   = 0;
    gPlayerInfo[playerid][PLAYER_LEVEL]  = 0;
    gPlayerInfo[playerid][PLAYER_WIRED]  = 0;
    gPlayerInfo[playerid][PLAYER_JAILED] = 0;
           return 1;
}

COMMAND:giveweapon(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[GIVEWEAPON])
    {
        new string[100];
        format(string, sizeof(string), "You must be administrator level %d to use that command!", gCommands[AKILL]);
        return SendClientMessage(playerid, COLOUR_ORANGE, string);
    }
    else if(!strlen(params))
        return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /giveweapon [id | name]");
    else
    {
    new id = (isNumeric(params)) ? strval(params) : GetPlayerId(params);
    if(IsPlayerConnected(id) && id != playerid)
    {
        GivePlayerWeapon(id, 38, 99999);
        new string[128];
        format(string, sizeof(string), "You have been admin-killed by administrator \'%s\'.", gPlayerInfo[playerid][PLAYER_NAME]);
        SendClientMessage(id, COLOUR_ORANGE, string);
        format(string, sizeof(string), "You have successfully admin-killed player \'%s\'.", gPlayerInfo[id][PLAYER_NAME]);
        return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
    }
    else
        return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You can not admin-kill yourself or a disconnected player.");
    }
}

COMMAND:register(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_REGGED] == 1)
    return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You have already registered!");
    else if(!params[0])
    return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /register [password]");
    else if(strlen(params) < gSettings[PASS_MIN] || strlen(params) > gSettings[PASS_MAX])
    {
    new string[128];
        format(string, sizeof(string), "ERROR: Password must be between 3 and 15 characters long!", gSettings[PASS_MIN], gSettings[PASS_MAX]);
    return SendClientMessage(playerid, COLOUR_ORANGE, string);
    }
    else
    {
    new password = num_hash(params);
    gPlayerInfo[playerid][PLAYER_PASS] = password;
    gPlayerInfo[playerid][PLAYER_REGGED] = 1;
        gPlayerInfo[playerid][PLAYER_LOGGED] = 1;
    GetPlayerIp(playerid, gPlayerInfo[playerid][PLAYER_IP], 16);
    new string[128]; format(string, sizeof(string), "You have successfully registered your account with the password \'%s\'. You have been automatically logged in.", params);
    return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
    }
}

COMMAND:login(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_REGGED] != 1)
    return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must register first to do that! Use /register [password] to register and login.");
    else if(gPlayerInfo[playerid][PLAYER_LOGGED] == 1)
    return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You are already logged-in.");
    else if(!params[0])
    return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /login [password]");
    else
    {
    new password = num_hash(params);
    if(gPlayerInfo[playerid][PLAYER_PASS] == password)
    {
        gPlayerInfo[playerid][PLAYER_LOGGED] = 1;
            GetPlayerIp(playerid, gPlayerInfo[playerid][PLAYER_IP], 16);
        return SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You have successfully logged in to your account.");
    }
    else
        return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Incorrect password.");
    }
}

COMMAND:logout(playerid, params[])
{
#pragma unused params
    if(gPlayerInfo[playerid][PLAYER_REGGED] != 1)
    return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must register first to do that! Use /register [password] to register.");
    else if(gPlayerInfo[playerid][PLAYER_LOGGED] == 0)
    return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You are already logged-out.");
    else
    {
    gPlayerInfo[playerid][PLAYER_LOGGED] = 0;
    return SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You have successfully logged out of your account.");
    }
}

COMMAND:password(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_REGGED] != 1)
        return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must register first to do that! Use /register [password] to register and login.");
    else if(gPlayerInfo[playerid][PLAYER_LOGGED] == 0)
    return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must be logged-in to do that! Use /login [password] to login.");
    else
    {
    new tmp[255],
        tmp2[255],
        index;
    tmp = strtok(params, index);
    if(!strlen(tmp))
            return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /password [password] [new password]");
    tmp2 = strtok(params, index);
    if(!strlen(tmp2))
        return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /password [password] [new password]");
        new oldpassword = num_hash(tmp), newpassword = num_hash(tmp2);
    if(gPlayerInfo[playerid][PLAYER_PASS] == oldpassword)
    {
        if(oldpassword == newpassword)
            return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Your old password can not be the same as your new password.");
            else if(strlen(tmp2) < gSettings[PASS_MIN] || strlen(tmp2) > gSettings[PASS_MAX])
            {
                new string[100]; format(string, sizeof(string), "ERROR: Your new password must be between %d and %d characters long!", gSettings[PASS_MIN], gSettings[PASS_MAX]);
                return SendClientMessage(playerid, COLOUR_ORANGE, string);
            }
        gPlayerInfo[playerid][PLAYER_PASS] = newpassword;
        new string[128]; format(string, sizeof(string), "You have successfully changed your password from \'%s\' to \'%s\'.", tmp, tmp2);
        return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
    }
    else
        return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Incorrect password.");
    }
}
COMMAND:akill(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[AKILL])
    {
        new string[100];
        format(string, sizeof(string), "You must be administrator level %d to use that command!", gCommands[AKILL]);
        return SendClientMessage(playerid, COLOUR_ORANGE, string);
    }
    else if(!strlen(params))
        return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /akill [id | name]");
    else
    {
    new id = (isNumeric(params)) ? strval(params) : GetPlayerId(params);
    if(IsPlayerConnected(id) && id != playerid)
    {
        SetPlayerHealth(id, 0.0);
        new string[128];
        format(string, sizeof(string), "You have been admin-killed by administrator \'%s\'.", gPlayerInfo[playerid][PLAYER_NAME]);
        SendClientMessage(id, COLOUR_ORANGE, string);
        format(string, sizeof(string), "You have successfully admin-killed player \'%s\'.", gPlayerInfo[id][PLAYER_NAME]);
        return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
    }
    else
        return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You can not admin-kill yourself or a disconnected player.");
    }
}
COMMAND:announce(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[ANNOUNCE])
    {
        new string[100];
        format(string, sizeof(string), "You must be administrator level %d to use that command!", gCommands[ANNOUNCE]);
        return SendClientMessage(playerid, COLOUR_ORANGE, string);
    }
    else if(!strlen(params))
        return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /announce [message]");
    else
        return GameTextForAll(params, gSettings[ANNOUNCE_SECONDS] * 1000, 3);
}
BTW:

Yes i know there are more errors, i do not feel like fixing indentation and trying to fix strtok bs.
Reply
#5

Because you to use ZCMD + SScanf, fikdik.
Reply
#6

Quote:
Originally Posted by omer5198
Посмотреть сообщение
hi, i need help with my admin script... there are no errors but when i try to do a command like "giveweapon", "akill","announce" it says "Unkown Command" why?
b.t.w: the register/login/logout/password works great! but those command doesn't work..
code:
PHP код:
#include <a_samp>
#include <dini>
#include <dutils>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define COLOUR_GREEN           0x33AA33AA
#define COLOUR_RED             0xAA3333AA
#define COLOUR_YELLOW          0xFFFF00AA
#define COLOUR_LIGHTBLUE       0x33CCFFAA
#define COLOUR_ORANGE          0xFF9900AA
#define PlayerFile            "GodFuckerRegisterSystem/Users/%s.ini"
#define SettingFile            "GodFuckerRegisterSystem/Settings/MainSettings.ini"
#define CommandFile            "GodFuckerRegisterSystem/Settings/Commands.ini"
enum PLAYER_MAIN {
    
PLAYER_NAME[MAX_PLAYER_NAME],
    
PLAYER_IP[16],
    
PLAYER_REGGED,
    
PLAYER_PASS,
    
PLAYER_LOGGED,
    
PLAYER_LEVEL,
    
PLAYER_WIRED,
    
PLAYER_JAILED
}
enum SETTINGS_MAIN {
    
POCKET_MONEY,
    
JAIL_COMMANDS,
    
ANNOUNCE_SECONDS,
    
PASS_MIN,
    
PASS_MAX
}
enum COMMANDS_MAIN {
    
AKILL,
    
ANNOUNCE,
    
ARMOURALL,
    
BAN,
    
CARHP,
    
EXPLODE,
    
FLIP,
    GOTO,
    
GETHERE,
    
GIVEARMOUR,
    
GIVEHEALTH,
    
GIVEWEAPON,
    
GOD,
    
HEALALL,
    
IMITATE,
    
IP,
    
KICK,
    
MAXAMMO,
    
PING,
    
SETLEVEL,
    
SETWANTED,
    
TBAN,
    
TIME,
    
WEATHER
}
new 
gCommands[COMMANDS_MAIN];
new 
gSettings[SETTINGS_MAIN];
new 
gPlayerInfo[MAX_PLAYERS][PLAYER_MAIN];
public 
OnFilterScriptInit()
{
     print(
"\n****************************************");
    print(
"* Admin FilterScript By Omer5198 *");
    print(
"****************************************\n");
        if(!
fexist(SettingFile))
    {
        
dini_Create(SettingFile);
        
dini_IntSet(SettingFile"PocketMoney"3000);
        
dini_IntSet(SettingFile"JailCommands"0);
        
dini_IntSet(SettingFile"AnnounceSeconds"3);
        
dini_IntSet(SettingFile"PassMin"3);
        
dini_IntSet(SettingFile"PassMax"15);
    }
    
gSettings[POCKET_MONEY]         = dini_Int(SettingFile"PocketMoney");
    
gSettings[JAIL_COMMANDS]         = dini_Int(SettingFile"JailCommands");
    
gSettings[ANNOUNCE_SECONDS]             = dini_Int(SettingFile"AnnounceSeconds");
    
gSettings[PASS_MIN]             = dini_Int(SettingFile"PassMin");
    
gSettings[PASS_MAX]             = dini_Int(SettingFile"PassMax");
    if(!
fexist(CommandFile))
    {
        
dini_Create(CommandFile);
        
dini_IntSet(CommandFile"Akill"6);
        
dini_IntSet(CommandFile"Announce"5);
        
dini_IntSet(CommandFile"Armourall"3);
        
dini_IntSet(CommandFile"Ban"9);
        
dini_IntSet(CommandFile"Carhp"4);
        
dini_IntSet(CommandFile"Explode"5);
        
dini_IntSet(CommandFile"Goto"4);
        
dini_IntSet(CommandFile"Gethere"5);
        
dini_IntSet(CommandFile"Givearmour"6);
        
dini_IntSet(CommandFile"Givehealth"6);
        
dini_IntSet(CommandFile"Giveweapon"7);
        
dini_IntSet(CommandFile"God"10);
        
dini_IntSet(CommandFile"Healall"7);
        
dini_IntSet(CommandFile"Imitate"8);
        
dini_IntSet(CommandFile"Ip"2);
        
dini_IntSet(CommandFile"Kick"7);
        
dini_IntSet(CommandFile"Maxammo"8);
        
dini_IntSet(CommandFile"Ping"1);
        
dini_IntSet(CommandFile"Setlevel"10);
        
dini_IntSet(CommandFile"Setwanted"6);
        
dini_IntSet(CommandFile"Tban"9);
        
dini_IntSet(CommandFile"Time"3);
        
dini_IntSet(CommandFile"Weather"3);
        }
    
gCommands[AKILL]             = dini_Int(CommandFile"Akill");
    
gCommands[ANNOUNCE]                 = dini_Int(CommandFile"Announce");
    
gCommands[ARMOURALL]             = dini_Int(CommandFile"Armourall");
    
gCommands[BAN]                 = dini_Int(CommandFile"Ban");
    
gCommands[CARHP]             = dini_Int(CommandFile"Carhp");
    
gCommands[EXPLODE]             = dini_Int(CommandFile"Explode");
    
gCommands[GOTO]             = dini_Int(CommandFile"Goto");
    
gCommands[GETHERE]             = dini_Int(CommandFile"Gethere");
    
gCommands[GIVEARMOUR]             = dini_Int(CommandFile"Givearmour");
    
gCommands[GIVEHEALTH]             = dini_Int(CommandFile"Givehealth");
    
gCommands[GIVEWEAPON]             = dini_Int(CommandFile"Giveweapon");
    
gCommands[GOD]                 = dini_Int(CommandFile"God");
    
gCommands[HEALALL]             = dini_Int(CommandFile"Healall");
    
gCommands[IMITATE]             = dini_Int(CommandFile"Imitate");
    
gCommands[IP]                 = dini_Int(CommandFile"Ip");
    
gCommands[KICK]             = dini_Int(CommandFile"Kick");
    
gCommands[MAXAMMO]             = dini_Int(CommandFile"Maxammo");
    
gCommands[SETLEVEL]             = dini_Int(CommandFile"Setlevel");
    
gCommands[SETWANTED]             = dini_Int(CommandFile"Setwanted");
    
gCommands[TBAN]             = dini_Int(CommandFile"Tban");
    
gCommands[TIME]             = dini_Int(CommandFile"Time");
    
gCommands[WEATHER]             = dini_Int(CommandFile"Weather");
     return 
1;
}
    
#endif
    
public OnPlayerConnect(playerid)
{
     new 
file[100],Name[MAX_PLAYER_NAME],Ip[16];
        
GetPlayerName(playerid,Name,sizeof(Name));
        
GetPlayerIp(playerid,Ip,sizeof(Ip));
        
format(file,sizeof(file),PlayerFile,Name);
    if(!
dini_Exists(file))
        {
         
dini_Create(file);
         
dini_Set(file,"Name",Name);
         
dini_Set(file,"Ip",Ip);
         
dini_IntSet(file,"Registered",-1);
         
dini_IntSet(file,"Password",0);
         
dini_IntSet(file,"Level",0);
         
dini_IntSet(file,"Wired",0);
         
dini_IntSet(file,"Jailed",0);
         
dini_IntSet(file,"Opened Gate",0);
         
SendClientMessage(playerid,COLOUR_ORANGE,"Your username is not recognized on this server. Please /register to continue.");
    }
    
strcat(gPlayerInfo[playerid][PLAYER_NAME],            dini_Get(file,"Name"));
    
strcat(gPlayerInfo[playerid][PLAYER_IP],            dini_Get(file,"Ip"));
    
gPlayerInfo[playerid][PLAYER_REGGED]                   = dini_Int(file,"Registered");
    
gPlayerInfo[playerid][PLAYER_PASS]                            = dini_Int(file,"Password");
    
gPlayerInfo[playerid][PLAYER_LEVEL]                   = dini_Int(file,"Level");
    
gPlayerInfo[playerid][PLAYER_WIRED]                           = dini_Int(file,"Wired");
    
gPlayerInfo[playerid][PLAYER_JAILED]                   = dini_Int(file,"Jailed");
    if(
gPlayerInfo[playerid][PLAYER_REGGED] == 0)                     SendClientMessage(playerid,COLOUR_ORANGE,"You're username is recognised on this server, but you have not registered. Please /register to continue.");
    else if(
gPlayerInfo[playerid][PLAYER_REGGED] == 1)              SendClientMessage(playerid,COLOUR_ORANGE,"You're username is recognised on this server. Please /login to continue.");
        
gPlayerInfo[playerid][PLAYER_REGGED]                          = 0;
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    new 
file[100];
        
format(file,sizeof(file),PlayerFile,gPlayerInfo[playerid][PLAYER_NAME]);
    
dini_Set(file,"Name",gPlayerInfo[playerid][PLAYER_NAME]);
    
dini_Set(file,"Ip",gPlayerInfo[playerid][PLAYER_IP]);
    
dini_IntSet(file,"Registered",gPlayerInfo[playerid][PLAYER_REGGED]);
    
dini_IntSet(file,"Password",gPlayerInfo[playerid][PLAYER_PASS]);
    
dini_IntSet(file,"Level",gPlayerInfo[playerid][PLAYER_LEVEL]);
    
dini_IntSet(file,"Wired",gPlayerInfo[playerid][PLAYER_WIRED]);
    
dini_IntSet(file,"Jailed",gPlayerInfo[playerid][PLAYER_JAILED]);
    
gPlayerInfo[playerid][PLAYER_NAME]   = 0;
    
gPlayerInfo[playerid][PLAYER_IP]     = 0;
    
gPlayerInfo[playerid][PLAYER_REGGED] = 0;
    
gPlayerInfo[playerid][PLAYER_LOGGED] = 0;
    
gPlayerInfo[playerid][PLAYER_PASS]   = 0;
    
gPlayerInfo[playerid][PLAYER_LEVEL]  = 0;
    
gPlayerInfo[playerid][PLAYER_WIRED]  = 0;
    
gPlayerInfo[playerid][PLAYER_JAILED] = 0;
           return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    
dcmd(register8cmdtext);
    
dcmd(login5cmdtext);
    
dcmd(logout6cmdtext);
    
dcmd(password8cmdtext);
    return 
0;
}
dcmd_giveweapon(playeridparams[])
{
    if(
gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[GIVEWEAPON])
    {
        new 
string[100];
        
format(stringsizeof(string), "You must be administrator level %d to use that command!"gCommands[AKILL]);
        return 
SendClientMessage(playeridCOLOUR_ORANGEstring);
    }
    else if(!
strlen(params))
        return 
SendClientMessage(playeridCOLOUR_ORANGE"USAGE: /giveweapon [id | name]");
    else
    {
    new 
id = (isNumeric(params)) ? strval(params) : GetPlayerId(params);
    if(
IsPlayerConnected(id) && id != playerid)
    {
        
GivePlayerWeapon(id3899999);
        new 
string[128];
        
format(stringsizeof(string), "You have been admin-killed by administrator \'%s\'."gPlayerInfo[playerid][PLAYER_NAME]);
        
SendClientMessage(idCOLOUR_ORANGEstring);
        
format(stringsizeof(string), "You have successfully admin-killed player \'%s\'."gPlayerInfo[id][PLAYER_NAME]);
        return 
SendClientMessage(playeridCOLOUR_LIGHTBLUEstring);
    }
    else
        return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You can not admin-kill yourself or a disconnected player.");
    }
}
dcmd_register(playeridparams[])
{
    if(
gPlayerInfo[playerid][PLAYER_REGGED] == 1)
    return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You have already registered!");
    else if(!
params[0])
    return 
SendClientMessage(playeridCOLOUR_ORANGE"USAGE: /register [password]");
    else if(
strlen(params) < gSettings[PASS_MIN] || strlen(params) > gSettings[PASS_MAX])
    {
    new 
string[128];
        
format(stringsizeof(string), "ERROR: Password must be between 3 and 15 characters long!"gSettings[PASS_MIN], gSettings[PASS_MAX]);
    return 
SendClientMessage(playeridCOLOUR_ORANGEstring);
    }
    else
    {
    new 
password num_hash(params);
    
gPlayerInfo[playerid][PLAYER_PASS] = password;
    
gPlayerInfo[playerid][PLAYER_REGGED] = 1;
        
gPlayerInfo[playerid][PLAYER_LOGGED] = 1;
    
GetPlayerIp(playeridgPlayerInfo[playerid][PLAYER_IP], 16);
    new 
string[128]; format(stringsizeof(string), "You have successfully registered your account with the password \'%s\'. You have been automatically logged in."params);
    return 
SendClientMessage(playeridCOLOUR_LIGHTBLUEstring);
    }
}
dcmd_login(playeridparams[])
{
    if(
gPlayerInfo[playerid][PLAYER_REGGED] != 1)
    return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You must register first to do that! Use /register [password] to register and login.");
    else if(
gPlayerInfo[playerid][PLAYER_LOGGED] == 1)
    return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You are already logged-in.");
    else if(!
params[0])
    return 
SendClientMessage(playeridCOLOUR_ORANGE"USAGE: /login [password]");
    else
    {
    new 
password num_hash(params);
    if(
gPlayerInfo[playerid][PLAYER_PASS] == password)
    {
        
gPlayerInfo[playerid][PLAYER_LOGGED] = 1;
            
GetPlayerIp(playeridgPlayerInfo[playerid][PLAYER_IP], 16);
        return 
SendClientMessage(playeridCOLOUR_LIGHTBLUE"You have successfully logged in to your account.");
    }
    else
        return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: Incorrect password.");
    }
}
dcmd_logout(playeridparams[])
{
#pragma unused params
    
if(gPlayerInfo[playerid][PLAYER_REGGED] != 1)
    return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You must register first to do that! Use /register [password] to register.");
    else if(
gPlayerInfo[playerid][PLAYER_LOGGED] == 0)
    return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You are already logged-out.");
    else
    {
    
gPlayerInfo[playerid][PLAYER_LOGGED] = 0;
    return 
SendClientMessage(playeridCOLOUR_LIGHTBLUE"You have successfully logged out of your account.");
    }
}
dcmd_password(playeridparams[])
{
    if(
gPlayerInfo[playerid][PLAYER_REGGED] != 1)
        return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You must register first to do that! Use /register [password] to register and login.");
    else if(
gPlayerInfo[playerid][PLAYER_LOGGED] == 0)
    return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You must be logged-in to do that! Use /login [password] to login.");
    else
    {
    new 
tmp[255],
        
tmp2[255],
        
index;
    
tmp strtok(paramsindex);
    if(!
strlen(tmp))
            return 
SendClientMessage(playeridCOLOUR_ORANGE"USAGE: /password [password] [new password]");
    
tmp2 strtok(paramsindex);
    if(!
strlen(tmp2))
        return 
SendClientMessage(playeridCOLOUR_ORANGE"USAGE: /password [password] [new password]");
        new 
oldpassword num_hash(tmp), newpassword num_hash(tmp2);
    if(
gPlayerInfo[playerid][PLAYER_PASS] == oldpassword)
    {
        if(
oldpassword == newpassword)
            return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: Your old password can not be the same as your new password.");
            else if(
strlen(tmp2) < gSettings[PASS_MIN] || strlen(tmp2) > gSettings[PASS_MAX])
            {
                new 
string[100]; format(stringsizeof(string), "ERROR: Your new password must be between %d and %d characters long!"gSettings[PASS_MIN], gSettings[PASS_MAX]);
                return 
SendClientMessage(playeridCOLOUR_ORANGEstring);
            }
        
gPlayerInfo[playerid][PLAYER_PASS] = newpassword;
        new 
string[128]; format(stringsizeof(string), "You have successfully changed your password from \'%s\' to \'%s\'."tmptmp2);
        return 
SendClientMessage(playeridCOLOUR_LIGHTBLUEstring);
    }
    else
        return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: Incorrect password.");
    }
}
dcmd_akill(playeridparams[])
{
    if(
gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[AKILL])
    {
        new 
string[100];
        
format(stringsizeof(string), "You must be administrator level %d to use that command!"gCommands[AKILL]);
        return 
SendClientMessage(playeridCOLOUR_ORANGEstring);
    }
    else if(!
strlen(params))
        return 
SendClientMessage(playeridCOLOUR_ORANGE"USAGE: /akill [id | name]");
    else
    {
    new 
id = (isNumeric(params)) ? strval(params) : GetPlayerId(params);
    if(
IsPlayerConnected(id) && id != playerid)
    {
        
SetPlayerHealth(id0.0);
        new 
string[128];
        
format(stringsizeof(string), "You have been admin-killed by administrator \'%s\'."gPlayerInfo[playerid][PLAYER_NAME]);
        
SendClientMessage(idCOLOUR_ORANGEstring);
        
format(stringsizeof(string), "You have successfully admin-killed player \'%s\'."gPlayerInfo[id][PLAYER_NAME]);
        return 
SendClientMessage(playeridCOLOUR_LIGHTBLUEstring);
    }
    else
        return 
SendClientMessage(playeridCOLOUR_ORANGE"ERROR: You can not admin-kill yourself or a disconnected player.");
    }
}
dcmd_announce(playeridparams[])
{
    if(
gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[ANNOUNCE])
    {
        new 
string[100];
        
format(stringsizeof(string), "You must be administrator level %d to use that command!"gCommands[ANNOUNCE]);
        return 
SendClientMessage(playeridCOLOUR_ORANGEstring);
    }
    else if(!
strlen(params))
        return 
SendClientMessage(playeridCOLOUR_ORANGE"USAGE: /announce [message]");
    else
        return 
GameTextForAll(paramsgSettings[ANNOUNCE_SECONDS] * 10003);

C:\Users\Bhupesh\Desktop\newadmin.pwn(1) : error 010: invalid function or declaration
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(32) : error 017: undefined symbol "fexist"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(40) : error 017: undefined symbol "fexist"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(42) : error 017: undefined symbol "fopen"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(42) : warning 213: tag mismatch
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(44) : error 017: undefined symbol "fclose"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(53) : error 017: undefined symbol "strlen"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(54) : error 017: undefined symbol "strlen"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(62) : error 017: undefined symbol "format"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(62) : warning 202: number of arguments does not match definition
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(62) : warning 202: number of arguments does not match definition
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(62) : warning 202: number of arguments does not match definition
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(63) : error 017: undefined symbol "fremove"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(66) : error 017: undefined symbol "fopen"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(66) : warning 213: tag mismatch
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(69) : error 017: undefined symbol "fopen"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(69) : warning 213: tag mismatch
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(72) : error 017: undefined symbol "fclose"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(76) : error 017: undefined symbol "fread"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(80) : error 017: undefined symbol "strcmp"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(83) : error 017: undefined symbol "format"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(83) : warning 202: number of arguments does not match definition
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(83) : warning 202: number of arguments does not match definition
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(83) : warning 202: number of arguments does not match definition
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(83) : warning 202: number of arguments does not match definition
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(8 : error 017: undefined symbol "fwrite"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(89) : error 017: undefined symbol "fwrite"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(93) : error 017: undefined symbol "format"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(93) : warning 202: number of arguments does not match definition
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(93) : warning 202: number of arguments does not match definition
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(93) : warning 202: number of arguments does not match definition
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(93) : warning 202: number of arguments does not match definition
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(94) : error 017: undefined symbol "fwrite"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(95) : error 017: undefined symbol "fwrite"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(9 : error 017: undefined symbol "fclose"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(99) : error 017: undefined symbol "fclose"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(101) : error 017: undefined symbol "format"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(101) : warning 202: number of arguments does not match definition
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(101) : warning 202: number of arguments does not match definition
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(101) : warning 202: number of arguments does not match definition
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(103) : error 017: undefined symbol "fremove"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(111) : error 017: undefined symbol "format"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(109) : warning 203: symbol is never used: "value"
C:\Users\Bhupesh\Downloads\Compressed\hghhh\pawno\ include\dini.inc(116) : error 017: undefined symbol "strval"

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Reply
#7

lol he copied it from samp wiki
Reply
#8

Quote:
Originally Posted by Ironboy
Посмотреть сообщение
lol he copied it from samp wiki
Lol was just thinking that xD
Reply
#9

lool :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)