Stock send message to admins.
#1

Can u give me a stock that send messages to all admin from this code:
Код:
CMD:setadmin(playerid, params[])
{
	if(PInfo[playerid][Admin] < 6 && !IsPlayerAdmin(playerid)) return 0;
	new targetid, level;
	if(sscanf(params, "ui", targetid, level)) return SCM(playerid, -1, "USAGE:setadmin playerid level);
	PInfo[targetid][Admin] = level;
	SCM(playerid, -1, "You have made player an admin);
	SCM(playerid, -1, "An admin has made u admin);
	return 1;
}
Reply
#2

This isn't a request section, it's a scripting help section. Have you tried doing it on your own, what obstacles are you facing in doing so?
Reply
#3

Abagail is right, but anyway.

PHP код:
stock SendAdminMessage(color,text[])
{
    for(new 
0GetPlayerPoolSize(); <= ji++)
    {
        if(
PInfo[i][Admin] > 0)
        {
            
SendClientMessage(i,color,text);
        }
    }
    return 
1;

Reply
#4

Quote:
Originally Posted by Osamakurdi
Посмотреть сообщение
Can u give me a stock that send messages to all admin from this code:
Код:
CMD:setadmin(playerid, params[])
{
	if(PInfo[playerid][Admin] < 6 && !IsPlayerAdmin(playerid)) return 0;
	new targetid, level;
	if(sscanf(params, "ui", targetid, level)) return SCM(playerid, -1, "USAGE:setadmin playerid level);
	PInfo[targetid][Admin] = level;
	SCM(playerid, -1, "You have made player an admin);
	SCM(playerid, -1, "An admin has made u admin);
	return 1;
}
there is no function in here that sends a message just to admins.

SCM stands for SendClientMessage

and secondly,the code is incorrect. it should be
PHP код:
SCM(playerid, -1"You have made player an admin);
SCM(targetid, -1, "
An admin has made u admin); 
Reply
#5

User, I believe that this function named as: "SCM", refers to a natively existing function, the "SendClientMessage".

Note that in the function below, it is missing to close the double quotation marks.
PHP код:
SCM(targetid, -1"An admin has made u admin); 
I think that would be correct:
PHP код:
SCM(targetid, -1"An admin has made an admin"); 
If you want a function to send a message to only the administrators of the server, use the base that the user gave above.
PHP код:
stock SendAdminMessage(color, const string[])
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            if(
PInfo[i][Admin] > 0)
            {
                
SendClientMessage(icolorstring);
            }
        }
    }

Everything is very simple, any doubt, only to be noted.
Reply
#6

Thx All Codes Works
Quote:
Originally Posted by Cycle
Посмотреть сообщение
User, I believe that this function named as: "SCM", refers to a natively existing function, the "SendClientMessage".

Note that in the function below, it is missing to close the double quotation marks.
PHP код:
SCM(targetid, -1"An admin has made u admin); 
I think that would be correct:
PHP код:
SCM(targetid, -1"An admin has made an admin"); 
If you want a function to send a message to only the administrators of the server, use the base that the user gave above.
PHP код:
stock SendAdminMessage(color, const string[])
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            if(
PInfo[i][Admin] > 0)
            {
                
SendClientMessage(playeridcolorstring);
            }
        }
    }

Everything is very simple, any doubt, only to be noted.
but
it should be
Код:
SendClientMessage(i, color, string);
Reply
#7

[QUOTE=Cycle;3990821]User, I believe that this function named as: "SCM", refers to a natively existing function, the "SendClientMessage".

Note that in the function below, it is missing to close the double quotation marks.
PHP код:
SCM(targetid, -1"An admin has made u admin); 
I think that would be correct:
PHP код:
SCM(targetid, -1"An admin has made an admin"); 
[QUOTE]

yeah i missed a ",my bad.
Reply
#8

Quote:
Originally Posted by Osamakurdi
Посмотреть сообщение
but
it should be
Код:
SendClientMessage(i, color, string);
yeah my bad, it should be i.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)