SA-MP Forums Archive
Pm from admin - 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: Pm from admin (/showthread.php?tid=587358)



Pm from admin - xTURBOx - 30.08.2015

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;
	}



Re: Pm from admin - JordanZaundd - 30.08.2015

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");}




Re: Pm from admin - Mariciuc223 - 30.08.2015

Yac. Old Old Old Old Old OnPlayerCommandText + Sscanf xD


Re: Pm from admin - Logofero - 30.08.2015

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


Re: Pm from admin - Mariciuc223 - 30.08.2015

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..


Re: Pm from admin - Logofero - 30.08.2015

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.


Re: Pm from admin - Infinity - 30.08.2015

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.


Re: Pm from admin - Mariciuc223 - 30.08.2015

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*


Re: Pm from admin - Arastair - 30.08.2015

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


Re: Pm from admin - IceBilizard - 30.08.2015

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;
}