SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 20/11/2019, 03:37 PM   #1
Danielknow
Big Clucker
 
Join Date: May 2018
Location: United States
Posts: 83
Reputation: 1
Default Admin command level prob

Hello guys, today i did some changes in the admin system and now some commands not working for the level i setted.

Code:
CMD:screen(playerid,params[])
{
	if(PlayerInfo[playerid][Admin] >= 2) return SendClientMessage(playerid, Dred, NOTALLOWED );
	new id,txt[50];
	if(sscanf(params,"ds[50]",id,txt)) return USG(playerid,"/Screen [Text]");
	if(id == playerid) return ERR(playerid,"You cannot screen yourself.");
	if(!IsPlayerConnected(id)) return ERR(playerid,"Player is not connected");
	if(PlayerInfo[id][Admin] > PlayerInfo[playerid][Admin]) return ERR(playerid,"You cant use this command on higher level admins");
	GameTextForPlayer(id,txt,4000,3);
	CMDMessageToAdmins(playerid,"SCREEN");
	Form(playerid,Lb,"* You have sent a screen message to %s(%d)",PlayerInfo[id][Nick],id);
	Form(id,blue,"* Administrator %s Has sent you screen message",PlayerInfo[playerid][Nick]);
	return 1;
}

Code:
if(PlayerInfo[playerid][Admin] >= 2) return SendClientMessage(playerid, Dred, NOTALLOWED );
Which one is correct? "<" or ">"

Or i need reset each each?
Danielknow is offline   Reply With Quote
Old 20/11/2019, 03:42 PM   #2
coool
Gangsta
 
coool's Avatar
 
Join Date: Feb 2013
Location: Republic of Pakistan
Posts: 609
Reputation: 54
Default Re: Admin command level prob

> greater than
< less than
Code:
if(PlayerInfo[playerid][Admin] >= 2) return SendClientMessage(playerid, Dred, NOTALLOWED );
will show the message for admin levels above 2.
< is correct
__________________
coool is online now   Reply With Quote
Old 20/11/2019, 04:12 PM   #3
Danielknow
Big Clucker
 
Join Date: May 2018
Location: United States
Posts: 83
Reputation: 1
Default Re: Admin command level prob

Quote:
Originally Posted by coool View Post
> greater than
< less than
Code:
if(PlayerInfo[playerid][Admin] >= 2) return SendClientMessage(playerid, Dred, NOTALLOWED );
will show the message for admin levels above 2.
< is correct
Yeah but seems i cant replace all with it.
because some commands still not working.
by the way when use the "=" ?
Danielknow is offline   Reply With Quote
Old 20/11/2019, 04:20 PM   #4
coool
Gangsta
 
coool's Avatar
 
Join Date: Feb 2013
Location: Republic of Pakistan
Posts: 609
Reputation: 54
Default Re: Admin command level prob

>= means greater than or equal to
__________________
coool is online now   Reply With Quote
Old 20/11/2019, 04:29 PM   #5
Joe Staff
High-roller
 
Join Date: Aug 2007
Posts: 2,596
Reputation: 379
Default Re: Admin command level prob

(variable>3) means any number 4 or higher
(Variable>=3) means any number 3 or higher
(Variable<3) means any number 2 or lower
(Variable<=3) means any number 3 or lower
Joe Staff is offline   Reply With Quote
Old 20/11/2019, 05:33 PM   #6
WalkZ
Big Clucker
 
WalkZ's Avatar
 
Join Date: Oct 2019
Location: Pakistan
Posts: 100
Reputation: 4
Default Re: Admin command level prob

PHP Code:
CMD:screen(playerid,params[])
{
    if(
PlayerInfo[playerid][Admin] < 2) return SendClientMessage(playeridDredNOTALLOWED );
    new 
id,txt[50];
    if(
sscanf(params,"ds[50]",id,txt)) return USG(playerid,"/Screen [Text]");
    if(
id == playerid) return ERR(playerid,"You cannot screen yourself.");
    if(!
IsPlayerConnected(id)) return ERR(playerid,"Player is not connected");
    if(
PlayerInfo[id][Admin] > PlayerInfo[playerid][Admin]) return ERR(playerid,"You cant use this command on higher level admins");
    
GameTextForPlayer(id,txt,4000,3);
    
CMDMessageToAdmins(playerid,"SCREEN");
    
Form(playerid,Lb,"* You have sent a screen message to %s(%d)",PlayerInfo[id][Nick],id);
    
Form(id,blue,"* Administrator %s Has sent you screen message",PlayerInfo[playerid][Nick]);
    return 
1;

__________________
[EN] Chinatown Freeroam [BETA]
- Different Advanced Deathmatches with Times and Scores
- Different Races
- Different Events
- Gangs (Groves, Ballas, Aztecas, Mafia, Bikers & Triads)
- Drugs with Drug Dealers at Streets
- Hitman Bounty System
- Ammunations, Pizza Stacks, Burger-Shots, Banks
- Jobs (Pizza-Boy, Plumber, Trasher, Bus)
- Money-Bag every 30 minutes
- Reaction Test every 15 minutes
- Daily improving by adding new features and fixing present bugs.
WalkZ is offline   Reply With Quote
Old 20/11/2019, 06:43 PM   #7
Danielknow
Big Clucker
 
Join Date: May 2018
Location: United States
Posts: 83
Reputation: 1
Default Re: Admin command level prob

Thanks guys, have problem in the script somewhere.
fixed it.
need set each each.
Danielknow is offline   Reply With Quote
Old 21/11/2019, 11:40 AM   #8
Danielknow
Big Clucker
 
Join Date: May 2018
Location: United States
Posts: 83
Reputation: 1
Default Re: Admin command level prob

Well. i did some changes in the levels and now i still cant use this command.

Code:
CMD:csetkills(playerid,params[])
{
	if(PlayerInfo[playerid][pAdmin]> 15) return SendClientMessage(playerid, Dred, NOTALLOWED );
	new id,pt;
	if(sscanf(params,"dd",id,pt)) return USG(playerid,"/csetkills (clanid) (kills)");
	if(pt < 0) return ERR(playerid,"Invalid Clan kills");
	new query[200];
	mysql_format(mysql, query, sizeof query, "UPDATE `clans` SET `ckills` = '%d' WHERE `cid`='%d' LIMIT 1", pt, id);
	mysql_tquery(mysql, query, "OnSetClanKills", "idd", playerid, id, pt);
	return 1;
}
Im admin level 16 and i still cant use this command for some reason.
Anyone have any idea for can fuck it?
Danielknow is offline   Reply With Quote
Old 21/11/2019, 01:22 PM   #9
WalkZ
Big Clucker
 
WalkZ's Avatar
 
Join Date: Oct 2019
Location: Pakistan
Posts: 100
Reputation: 4
Default Re: Admin command level prob

Well read my post upper and see i already explained, This way you are making command for higher level than 15.

It should work now with using < for admin level checking so this way if someone has lower admin level than 15 he wont be able to use this command.

PHP Code:
CMD:csetkills(playerid,params[])
{
    if(
PlayerInfo[playerid][pAdmin] < 15) return SendClientMessage(playeridDredNOTALLOWED );
    new 
id,pt;
    if(
sscanf(params,"dd",id,pt)) return USG(playerid,"/csetkills (clanid) (kills)");
    if(
pt 0) return ERR(playerid,"Invalid Clan kills");
    new 
query[200];
    
mysql_format(mysqlquerysizeof query"UPDATE `clans` SET `ckills` = '%d' WHERE `cid`='%d' LIMIT 1"ptid);
    
mysql_tquery(mysqlquery"OnSetClanKills""idd"playerididpt);
    return 
1;

__________________
[EN] Chinatown Freeroam [BETA]
- Different Advanced Deathmatches with Times and Scores
- Different Races
- Different Events
- Gangs (Groves, Ballas, Aztecas, Mafia, Bikers & Triads)
- Drugs with Drug Dealers at Streets
- Hitman Bounty System
- Ammunations, Pizza Stacks, Burger-Shots, Banks
- Jobs (Pizza-Boy, Plumber, Trasher, Bus)
- Money-Bag every 30 minutes
- Reaction Test every 15 minutes
- Daily improving by adding new features and fixing present bugs.
WalkZ is offline   Reply With Quote
Old 21/11/2019, 01:42 PM   #10
Danielknow
Big Clucker
 
Join Date: May 2018
Location: United States
Posts: 83
Reputation: 1
Default Re: Admin command level prob

Quote:
Originally Posted by WalkZ View Post
Well read my post upper and see i already explained, This way you are making command for higher level than 15.

It should work now with using < for admin level checking so this way if someone has lower admin level than 15 he wont be able to use this command.

PHP Code:
CMD:csetkills(playerid,params[])
{
    if(
PlayerInfo[playerid][pAdmin] < 15) return SendClientMessage(playeridDredNOTALLOWED );
    new 
id,pt;
    if(
sscanf(params,"dd",id,pt)) return USG(playerid,"/csetkills (clanid) (kills)");
    if(
pt 0) return ERR(playerid,"Invalid Clan kills");
    new 
query[200];
    
mysql_format(mysqlquerysizeof query"UPDATE `clans` SET `ckills` = '%d' WHERE `cid`='%d' LIMIT 1"ptid);
    
mysql_tquery(mysqlquery"OnSetClanKills""idd"playerididpt);
    return 
1;

The thing i trying to say its.
I did replace text to all Admin Commands and now some working like i want and some no, its work for wrong levels.

Now its bug in the script or somewhere else?..
Danielknow is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/admin cmd prob rakinz Scripting Help 4 16/02/2017 09:48 PM
A prob with a command.. Steezy_ Scripting Help 2 04/07/2013 06:41 PM
How to Add Admin Level's To The Admin System BlazingKnife Scripting Help 2 07/05/2013 11:22 AM
Set Admin Level command IvancheBG Scripting Help 15 16/09/2012 01:55 PM
/help Command / IsAtCarshop Prob nickbugun Help Archive 3 14/04/2009 05:54 PM


All times are GMT. The time now is 04:37 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.