SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 30/09/2018, 08:23 PM   #1
TaligaroW
Little Clucker
 
Join Date: Jun 2018
Posts: 24
Reputation: 0
Default Help for this message

Hey everyone,i want to make line 33 in the PHP below to be seen only by admins,can anyone please help me?
PHP Code:
CMD:makeadmin(playerid params[])
{
     
GetPlayerName(playerid,name,sizeof(name));
     
format(inamesizeof(iname),"%s.ini",name);
     if(
dini_Int(iname,"Admin")<5&&!IsPlayerAdmin(playerid))
     {
     
SendClientMessage(playerid,COLOR_ORANGE,"Нямаш права за тази команда");
     return 
1;
     }
     new 
idlevel;
     if (
sscanf(params"ud"idlevel)) SendClientMessage(playerid0xFF0000AA"Използвай: \"/makeadmin <playerid> <level>\"");
     else if (
id == INVALID_PLAYER_IDSendClientMessage(playerid0xFF0000AA"Player not found");
     else
     if(
dini_Int(iname,"Admin")==5&&level>4)
     {
     
SendClientMessage(playerid,COLOR_RED"Максималното админ ниво,което админ 5 може да връчи е 4");
     return 
1;
     }
     {
     new 
string[256];
     
GetPlayerName(id,name,sizeof(name));
     new 
aname[MAX_PLAYER_NAME];
     
GetPlayerName(playerid,aname,sizeof(aname));
     if(
level == 0)
     {
        if(
dini_Int(iname,"Admin")<5)
      
format(stringsizeof(string), "Администратор {63E5E7}%s премахна админските права на %s"aname,name);
      
SendClientMessageToAll(COLOR_REDstring);
     }
     else
     if(
level == 0)
     
format(stringsizeof(string), "Администратор {63E5E7}%s премахна админските права на %s"aname,name);
      
SendClientMessageToAll(COLOR_REDstring);
     {
     {
     
format(stringsizeof(string),"Администратор {63E5E7}%s направи %s админ с %d левъл права.{00FF00}Честито!",aname ,namelevel);
     }
     
format(inamesizeof(iname),"%s.ini",name);
     
dini_IntSet(iname"Admin"level);
     
SendClientMessageToAll(COLOR_REDstring);
     return 
1;
     }
     return 
1;
}

TaligaroW is offline   Reply With Quote
Old 30/09/2018, 08:56 PM   #2
TaligaroW
Little Clucker
 
Join Date: Jun 2018
Posts: 24
Reputation: 0
Default Re: Help for this message

Anyone?
TaligaroW is offline   Reply With Quote
Old 01/10/2018, 04:13 AM   #3
UFF
Banned
 
Join Date: Feb 2018
Location: Funky World
Posts: 346
Reputation: 28
Default Re: Help for this message

use this function

Code:
SendAdminMessage(color, mzgz[])
{
	foreach(new i : Player)
	{
	    if(YourAdminVariable[i] == 0)
			if(!IsPlayerAdmin(i)) continue;
    	    SendClientMessage(i, color, mzgz);
	}
}
SendAdminMessage will send the message only to the administators.

Usage: SendAdminMessage(COLOR," Text ");
UFF 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
OnPlayerSpawn callback message duplicated or even start flood message Groc Scripting Help 16 15/04/2017 08:43 PM
Random Message fast message bigboy81 Scripting Help 5 24/01/2015 07:13 PM
[FilterScript] Server Message [SERVER TIPS, SERVER MESSAGE OF THE DAY] - Simple, basic but editable! roar Filterscripts 10 28/02/2013 02:19 PM
Send to admin other message and to player other message lonako45 Scripting Help 10 24/04/2012 12:35 PM
Need help changing the IRC message but not the In-Game message. OleKristian95 Scripting Help 3 07/04/2012 02:20 PM


All times are GMT. The time now is 02:38 AM.


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