/R Reply PM
#1

Код:
CMD:pm(playerid,params[]) {
	new id, gMessage[128],Message[128],iName[MAX_PLAYER_NAME], pmName[MAX_PLAYER_NAME];
	if (sscanf(params, "is",id,gMessage)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /pm <ID> <Message>");
	if(!IsPlayerConnected(id)) {
		SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/pm : Bad player ID");
		return 1;
	}
	if(playerid == id) {
		SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"You cannot PM yourself");
		return 1;
	}
	if(ServerInfo[ReadPMs] == 1 && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel])
	{
    	new string[128],recievername[MAX_PLAYER_NAME];
		GetPlayerName(playerid, string, sizeof(string)); GetPlayerName(id, recievername, sizeof(recievername));
		format(string, sizeof(string), "***PM: %s To %s: %s", string, recievername, gMessage);
		for (new a = 0; a < MAX_PLAYERS; a++) if ((PlayerInfo[a][Level] >= ServerInfo[MaxAdminLevel]) && a != playerid)
		SendClientMessage(a, grey, string);
	}
 	if(PlayerInfo[playerid][Muted] == 1)
	{
		new string[128];
 		PlayerInfo[playerid][MuteWarnings]++;
		if(PlayerInfo[playerid][MuteWarnings] < ServerInfo[MaxMuteWarnings]) {
			format(string, sizeof(string),"WARNING: You are muted, if you continue to speak you will be kicked (Warning: %d/%d)", PlayerInfo[playerid][MuteWarnings], ServerInfo[MaxMuteWarnings] );
			SendClientMessage(playerid,red,string);
		} else {
			SendClientMessage(playerid,red,"You have been warned! Now you have been kicked");
			GetPlayerName(playerid, string, sizeof(string));
			format(string, sizeof(string),"%s [ID %d] Kicked for exceeding mute warnings", string, playerid);
			SendClientMessageToAll(grey,string);
			SaveToFile("KickLog",string); Kick(playerid);
		}
		return 0;
	}
	GetPlayerName(id,iName,sizeof(iName));
	GetPlayerName(playerid,pmName,sizeof(pmName));
	format(Message,sizeof(Message),">> %s(%d): %s",iName,id,gMessage);
	SendClientMessage(playerid,PM_OUTGOING_COLOR,Message);
	format(Message,sizeof(Message),"** %s(%d): %s",pmName,playerid,gMessage);
	SendClientMessage(id,PM_INCOMING_COLOR,Message);
	PlayerPlaySound(id,1085,0.0,0.0,0.0);
	printf("PM: %s",Message);
	return 1;
}
does anyone know how to make /r?

i mean,i want reply last send pm using /r


coz few player complaint coz my server dont have /r
Reply
#2

Quote:
Originally Posted by KyNe
Посмотреть сообщение
Код:
CMD:pm(playerid,params[]) {
	new id, gMessage[128],Message[128],iName[MAX_PLAYER_NAME], pmName[MAX_PLAYER_NAME];
	if (sscanf(params, "is",id,gMessage)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /pm <ID> <Message>");
	.......
}
does anyone know how to make /r?

i mean,i want reply last send pm using /r

coz few player complaint coz my server dont have /r
"coz few player complaint coz my server dont have /r " lol do your players know scripting? /pm itself is the reply
what would the /reply(/r) do? it would be the same as /pm ... explain more, how would the /r cmd be different?
this is irrelevant to me.
Reply
#3

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
"coz few player complaint coz my server dont have /r " lol do your players know scripting? /pm itself is the reply
what would the /reply(/r) do? it would be the same as /pm ... explain more, how would the /r cmd be different?
this is irrelevant for me.
i mean

if someone pm them,then they can use /r without /pm ID text

they just use /r text
Reply
#4

Quote:
Originally Posted by KyNe
Посмотреть сообщение
i mean

if someone pm them,then they can use /r without /pm ID text

they just use /r text
Aha, now that's more clear, okay well i actually have an idea for this, code:
PHP код:
new iPmYou[MAX_PLAYERS]; //on top of your script
CMD:pm(playerid,params[]) {//new /pm cmd
    
new idgMessage[128],Message[128],iName[MAX_PLAYER_NAME], pmName[MAX_PLAYER_NAME];
    if (
sscanf(params"is",id,gMessage)) return SendClientMessage(playeridCOLOR_LIGHTBLUE"USAGE: /pm <ID> <Message>");
    if(!
IsPlayerConnected(id)) {
        
SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/pm : Bad player ID");
        return 
1;
    }
    if(
playerid == id) {
        
SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"You cannot PM yourself");
        return 
1;
    }
    if(
ServerInfo[ReadPMs] == && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel])
    {
        new 
string[128],recievername[MAX_PLAYER_NAME];
        
GetPlayerName(playeridstringsizeof(string)); GetPlayerName(idrecievernamesizeof(recievername));
        
format(stringsizeof(string), "***PM: %s To %s: %s"stringrecievernamegMessage);
        for (new 
0MAX_PLAYERSa++) if ((PlayerInfo[a][Level] >= ServerInfo[MaxAdminLevel]) && != playerid)
        
SendClientMessage(agreystring);
    }
     if(
PlayerInfo[playerid][Muted] == 1)
    {
        new 
string[128];
         
PlayerInfo[playerid][MuteWarnings]++;
        if(
PlayerInfo[playerid][MuteWarnings] < ServerInfo[MaxMuteWarnings]) {
            
format(stringsizeof(string),"WARNING: You are muted, if you continue to speak you will be kicked (Warning: %d/%d)"PlayerInfo[playerid][MuteWarnings], ServerInfo[MaxMuteWarnings] );
            
SendClientMessage(playerid,red,string);
        } else {
            
SendClientMessage(playerid,red,"You have been warned! Now you have been kicked");
            
GetPlayerName(playeridstringsizeof(string));
            
format(stringsizeof(string),"%s [ID %d] Kicked for exceeding mute warnings"stringplayerid);
            
SendClientMessageToAll(grey,string);
            
SaveToFile("KickLog",string); Kick(playerid);
        }
        return 
0;
    }
    
GetPlayerName(id,iName,sizeof(iName));
    
GetPlayerName(playerid,pmName,sizeof(pmName));
    
format(Message,sizeof(Message),">> %s(%d): %s",iName,id,gMessage);
    
SendClientMessage(playerid,PM_OUTGOING_COLOR,Message);
    
format(Message,sizeof(Message),"** %s(%d): %s",pmName,playerid,gMessage);
    
SendClientMessage(id,PM_INCOMING_COLOR,Message);
    
PlayerPlaySound(id,1085,0.0,0.0,0.0);
    
printf("PM: %s",Message);
    
iPmYou[id]=playerid;
    return 
1;
}
CMD:r(playerid,params[]) { //the /r cmd
    
new gMessage[128],Message[128],iName[MAX_PLAYER_NAME], pmName[MAX_PLAYER_NAME];
    if (
sscanf(params"s",gMessage)) return SendClientMessage(playeridCOLOR_LIGHTBLUE"USAGE: /r <Message>");
    if(!
IsPlayerConnected(iPmYou[playerid])) {
        
SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/r bad id: The player has disconnected");
        return 
1;
    }
    if(
ServerInfo[ReadPMs] == && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel])
    {
        new 
string[128],recievername[MAX_PLAYER_NAME];
        
GetPlayerName(playeridstringsizeof(string)); GetPlayerName(iPmYou[playerid], recievernamesizeof(recievername));
        
format(stringsizeof(string), "***PM: %s To %s: %s"stringrecievernamegMessage);
        for (new 
0MAX_PLAYERSa++) if ((PlayerInfo[a][Level] >= ServerInfo[MaxAdminLevel]) && != playerid)
        
SendClientMessage(agreystring);
    }
     if(
PlayerInfo[playerid][Muted] == 1)
    {
        new 
string[128];
         
PlayerInfo[playerid][MuteWarnings]++;
        if(
PlayerInfo[playerid][MuteWarnings] < ServerInfo[MaxMuteWarnings]) {
            
format(stringsizeof(string),"WARNING: You are muted, if you continue to speak you will be kicked (Warning: %d/%d)"PlayerInfo[playerid][MuteWarnings], ServerInfo[MaxMuteWarnings] );
            
SendClientMessage(playerid,red,string);
        } else {
            
SendClientMessage(playerid,red,"You have been warned! Now you have been kicked");
            
GetPlayerName(playeridstringsizeof(string));
            
format(stringsizeof(string),"%s [ID %d] Kicked for exceeding mute warnings"stringplayerid);
            
SendClientMessageToAll(grey,string);
            
SaveToFile("KickLog",string); Kick(playerid);
        }
        return 
0;
    }
    
GetPlayerName(iPmYou[playerid],iName,sizeof(iName));
    
GetPlayerName(playerid,pmName,sizeof(pmName));
    
format(Message,sizeof(Message),">> %s(%d): %s",iName,iPmYou[playerid],gMessage);
    
SendClientMessage(playerid,PM_OUTGOING_COLOR,Message);
    
format(Message,sizeof(Message),"** %s(%d): %s",pmName,playerid,gMessage);
    
SendClientMessage(iPmYou[playerid],PM_INCOMING_COLOR,Message);
    
PlayerPlaySound(iPmYou[playerid],1085,0.0,0.0,0.0);
    
printf("PM: %s",Message);
    
iPmYou[playerid]=-1;
    return 
1;

try this and lemme know if it works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)