SA-MP Forums Archive
weird command does not work - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: weird command does not work (/showthread.php?tid=592033)



weird command does not work - IndependentGaming - 19.10.2015

Hello, i try to edit some commands, but i dont understand it there is only 1 rank of this and it says that I'm not authorized to use it since i made my self that rank see the example


https://gyazo.com/c2c568b8d9e8e383a7b79d3e02fecc2e


the command:


PHP код:
CMD:hname(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 1338 && PlayerInfo[playerid][pHouseModerator] == 1)
    {
        
SendClientMessageEx(playeridCOLOR_GRAD2"You are not authorized to use that command.");
        return 
1;
    }
    new 
string[128], houseidownername[24];
    if(
sscanf(params"ds[24]"houseidownername)) return SendClientMessageEx(playeridCOLOR_GREY"USAGE: /hname [houseid] [name]");
    
format(HouseInfo[houseid][hOwnerName], 24"%s"ownername);
    
format(stringsizeof(string), "You have set the house owner to %s"ownername);
    
HouseInfo[houseid][hOwned] = 1;
    
SendClientMessageEx(playeridCOLOR_WHITEstring);
    
ReloadHouseText(houseid);
    
SaveHouse(houseid);
    
format(stringsizeof(string), "%s has edited HouseID %d's Owner to %s."GetPlayerNameEx(playerid), houseidownername);
    
Log("logs/hedit.log"string);
    return 
1;

Im Admin level 99999 and made my self Housemoderator but when i got the rank i cant use the command and when i remove it i can use it because im above 1338 but i made == 1 because i have just 1 rank and if i do it like this >= 1 i got the same problem if i use == changing && to || does not work ether.


Re: weird command does not work - karemmahmed22 - 19.10.2015

Not sure but seems your House Moderator command sets your level to something instead of 1..
Maybe 0, 2 or even 3..
Can you show us House Moderator set command?
Or try this, Should work..
PHP код:
CMD:hname(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 1338 && PlayerInfo[playerid][pHouseModerator] != 1)
    {
        
SendClientMessageEx(playeridCOLOR_GRAD2"You are not authorized to use that command.");
        return 
1;
    }
    new 
string[128], houseidownername[24];
    if(
sscanf(params"ds[24]"houseidownername)) return SendClientMessageEx(playeridCOLOR_GREY"USAGE: /hname [houseid] [name]");
    
format(HouseInfo[houseid][hOwnerName], 24"%s"ownername);
    
format(stringsizeof(string), "You have set the house owner to %s"ownername);
    
HouseInfo[houseid][hOwned] = 1;
    
SendClientMessageEx(playeridCOLOR_WHITEstring);
    
ReloadHouseText(houseid);
    
SaveHouse(houseid);
    
format(stringsizeof(string), "%s has edited HouseID %d's Owner to %s."GetPlayerNameEx(playerid), houseidownername);
    
Log("logs/hedit.log"string);
    return 
1;




Re: weird command does not work - AbyssMorgan - 19.10.2015

PHP код:
if(PlayerInfo[playerid][pAdmin] < 1338 || PlayerInfo[playerid][pHouseModerator] != 1) return SendClientMessageEx(playeridCOLOR_GRAD2"You are not authorized to use that command."); 



Re: weird command does not work - karemmahmed22 - 19.10.2015

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
PHP код:
if(PlayerInfo[playerid][pAdmin] < 1338 || PlayerInfo[playerid][pHouseModerator] != 1) return SendClientMessageEx(playeridCOLOR_GRAD2"You are not authorized to use that command."); 
Are you serious? You just copied my line above mate...
Please if you can't help the guy, Don't bother yourself fucking posting, I already posted something which will help him..
You just copied my code above, And placed return, removed brackets, placed the SCMex..
Please..


Re: weird command does not work - Crystallize - 19.10.2015

Код:
CMD:hname(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1338  ||  PlayerInfo[playerid][pHouseModerator] == 1)
    {
        SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use that command.");
        return 1;
    }

    new string[128], houseid, ownername[24];
    if(sscanf(params, "ds[24]", houseid, ownername)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /hname [houseid] [name]");

    format(HouseInfo[houseid][hOwnerName], 24, "%s", ownername);
    format(string, sizeof(string), "You have set the house owner to %s", ownername);
    HouseInfo[houseid][hOwned] = 1;
    SendClientMessageEx(playerid, COLOR_WHITE, string);
    ReloadHouseText(houseid);
    SaveHouse(houseid);

    format(string, sizeof(string), "%s has edited HouseID %d's Owner to %s.", GetPlayerNameEx(playerid), houseid, ownername);
    Log("logs/hedit.log", string);

    return 1;
}