how to short this cmd (ycmd) - 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: how to short this cmd (ycmd) (
/showthread.php?tid=464315)
how to short this cmd (ycmd) -
Scrillex - 16.09.2013
I want this cmd like ycmd:r(playerid,prams[],help)
pawn Код:
YCMD:reply(playerid, params[],help)
{
new text[128], string[128];
if(sscanf(params, "s", text)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /reply (message) - Enter your message");
new pID = pInfo[playerid][Last];
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "Player is not connected.");
if(pID == playerid) return SendClientMessage(playerid, COLOR_RED, "You cannot PM yourself.");
format(string, sizeof(string), "%s (%d) is not accepting private messages at the moment.", PlayerName(pID), pID);
if(pInfo[pID][NoPM] == 1) return SendClientMessage(playerid, COLOR_RED, string);
format(string, sizeof(string), "PM to %s: %s", PlayerName(pID), text);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "PM from %s: %s", PlayerName(playerid), text);
SendClientMessage(pID, COLOR_YELLOW, string);
pInfo[pID][Last] = playerid;
return 1;
}
Re: how to short this cmd (ycmd) -
Konstantinos - 16.09.2013
pawn Код:
YCMD:r(playerid, params[], help)
{
return Command_ReProcess(playerid, "/reply", 0);
}
Or:
pawn Код:
// In OnGameModeInit (I guess):
Command_AddAltNamed("/reply", "/r");
I'm not 100 percent sure though, it's been long time since I last used y_commands.
Re: how to short this cmd (ycmd) -
Scrillex - 16.09.2013
Thanks mate