11.08.2011, 17:18
Hello guys.. i'd appreciate it if some one will give me a /pm cmd for DCMD
dcmd_pm(playerid,params[])
{
new tmp[256], idx, string[256],player1, pid[256];
pid = strtok(params, idx); tmp = strtok(params, idx);
if(!strlen(pid) || !strlen(tmp)) return SendClientMessage(playerid,red,"Usage: /pm [ID] [message]");
player1=strval(pid);
if(IsPlayerConnected(player1))
{
format(string,sizeof(string), "PM from %s (ID:%d): %s", pName(playerid),playerid, params[strlen(pid)+1]);
SendClientMessage(player1,0xFFDC18FF,string);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(player1, X,Y,Z);
PlayerPlaySound(player1, 1058, X, Y, Z);
format(string,sizeof(string), "PM sent to %s (ID:%d): %s", pName(player1),player1, params[strlen(pid)+1]);
SendClientMessage(playerid,0xFFDC18FF,string);
format(string, sizeof(string), "***PM: %s To %s: %s", pName(playerid), pName(player1), params[strlen(pid)+1]);
print(string);
if(IsPlayerNPC(player1))
{
format(string,sizeof(string), "PM from %s (ID:%d): Hello %s, I'm a bot and I won't answer you.", pName(player1),player1, pName(playerid));
SendClientMessage(playerid,0xFFDC18FF,string);
print(string);
GetPlayerPos(playerid, X,Y,Z);
PlayerPlaySound(playerid, 1058, X, Y, Z);
}
}
else return SendClientMessage(playerid,red,"ERROR: This player is not connected.");
return 1;
}
pawn Код:
Greetings, Jeffry |
Do you know how to create some normal commands? /help, /commands try to understand ZCMD/DCMD whatever you are using.
|