Pm from admin
#1

I want to make a cmd /apm which will Say PMFROMADMIN:message
usage could be /apm (id) (message)
Example:
/apm 1 HI
will send this to the player id 1
[PMFROMADMIN]:HI

i use lux admin below is the code of lux admin

Код:
if(strcmp(cmd, "/help", true) == 0)
	{
	if(IsPlayerLuxAdmin(playerid))
	{
	//Function Here
	}
	else SendClientMessage(playerid, COLOR_WHITE, "ERROR: You not is Administrator");
  return 1;
	}
Reply
#2

Let me know if this works! Don't forget to define COLOR_LIGHTGREEN if you haven't done it already.

PHP код:
#define COLOR_LIGHTGREEN 0x7CFC00AA
if(strcmp(cmd"/apm"true) == 0)
{
    if(
IsPlayerLuxAdmin(playerid))
    {
        new 
idstring[128];
        if(
sscanf(params"us[128]"idstring))
        {return 
SendClientMessage(playeridCOLOR_WHITE"USAGE: /apm [playerid] [message]");}
        else if(!
IsPlayerConnected(id))
        {return 
SendClientMessage(playeridCOLOR_WHITE"ERROR: Invalid Player ID");}
        else
        {
            new 
str[128];
            
format(strsizeof(str), "[PMFROMADMIN]: %s"string);
            
SendClientMessage(idCOLOR_LIGHTGREENstr);
        }
    }else{return 
SendClientMessage(playeridCOLOR_WHITE"ERROR: You're not an Administrator");}

Reply
#3

Yac. Old Old Old Old Old OnPlayerCommandText + Sscanf xD
Reply
#4

Quote:
Originally Posted by Mariciuc223
Посмотреть сообщение
Yac. Old Old Old Old Old OnPlayerCommandText + Sscanf xD
Why is that? I do not think the use of documentary features something awful. All now enjoy zcmd fashion? Mass psychosis? The same can be done in OnPlayerCommandText
Reply
#5

Quote:
Originally Posted by Logofero
Посмотреть сообщение
Why is that? I do not think the use of documentary features something awful. All now enjoy zcmd fashion? Mass psychosis? The same can be done in OnPlayerCommandText
So, ZCMD are easiest and faster..
Reply
#6

Quote:
Originally Posted by Mariciuc223
Посмотреть сообщение
So, ZCMD are easiest and faster..
Who told you that it is faster and why? It's just a wrapper over standard OnPlayerCommandText

Just why do you think that something better is that it uses a lot of people, and not something that you like personally.
Reply
#7

Quote:
Originally Posted by Logofero
Посмотреть сообщение
Who told you that it is faster and why? It's just a wrapper over standard OnPlayerCommandText

Just why do you think that something better is that it uses a lot of people, and not something that you like personally.
And that's why you're wrong. Zcmd isn't just a wrapper and it is significantly faster.
Reply
#8

Quote:
Originally Posted by Logofero
Посмотреть сообщение
Who told you that it is faster and why? It's just a wrapper over standard OnPlayerCommandText

Just why do you think that something better is that it uses a lot of people, and not something that you like personally.
Now tell me y_ini or mysql are not faster than 'file functions' , are just a wrapper ... ha ? *joking*
Reply
#9

Quote:
Originally Posted by Mariciuc223
Посмотреть сообщение
Yac. Old Old Old Old Old OnPlayerCommandText + Sscanf xD
OnPlayerCommandText, the memories man, the struggles
Reply
#10

pawn Код:
CMD:apm(playerid, params[])
{
    new tmp[256], giveplayerid, giveplayer[25], playername[25],string[256], string2[256];
    GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
    if (sscanf(params, "us[128]", giveplayerid, tmp)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /apm [playerid] [message]");
    if (!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_RED, "Error: Inactive player id!");
    if (giveplayerid == playerid) return SendClientMessage(playerid, COLOR_RED, "Error: You can't admin pm your self!");
    GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
    GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
    format(string, sizeof(string), "[PM From STAFF]: %s(%d): %s", playername, playerid, tmp);
    SendClientMessage(giveplayerid, COLOR_RED, string);
    format(string2,sizeof(string2), "[PM From STAFF]: %s(%d) > %s(%d): %s", playername, playerid, giveplayer, giveplayerid, tmp);
    SendMessageToAdmins(COLOR_RED, string2);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)