PDA

View Full Version : How to make reply command


alvin6
20/06/2019, 12:48 PM
Hey there everyone i hope you all doing good im trying to make /reply command for /pm on my server but it is not working can anyone please help

My pm command code for which i want reply command :
CMD:pm ( playerid, params[] )
{
new str1[128], msg[128], str2[128], str3[128], giveid;
if ( sscanf(params, "us[128]", giveid, msg)) return SendClientMessage( playerid, USAGE, ""ORANGE"USAGE: /pm <ID> <Text>" );
if ( giveid == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, ""RED"ERROR: "GREY"Invalid player ID!" );
format( str1, sizeof(str1), "{2CE8BF}PM sent to {%06x}%s(%d){2CE8BF}: {ACE2E6}%s", (GetPlayerColor(giveid) >>> 8), GetName( giveid ), giveid, msg );
format( str2, sizeof(str2), "{2CE8BF}PM received from {%06x}%s(%d){2CE8BF}: {ACE2E6}%s", (GetPlayerColor(playerid) >>> 8), GetName( playerid ), playerid, msg );
if ( PlayerInfo[ giveid ][ DisablePMs ] == 1 )
{
format( str3, sizeof(str3), ""RED"ERROR: "GREY"%s(%d) has private messages disabled!", GetName( giveid ), giveid );
SendClientMessage( playerid, -1, str3 );
return 1;
}
if ( PlayerInfo[ playerid ][ Muted ] >= 1 )
{
SendClientMessage( playerid, -1, ""RED"ERROR: "GREY"You are muted!" );
return 1;
}
GameTextForPlayer( giveid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~~h~PM received!", 3000, 3 );
GameTextForPlayer( playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~~h~PM sent!", 3000, 3 );
SendClientMessage( playerid, -1, str1 );
SendClientMessage( giveid, -1, str2 );
return 1;
}

oghabanjb
20/06/2019, 05:16 PM
See here:
https://pastebin.com/HFZFjc3J
Credits: MouseBreaker, YoYo123