Posts: 102
Threads: 24
Joined: Jul 2010
Reputation:
0
well i tried making the /pm command but with my script it showed nothing to the other player.
So how could i make a /pm? do i use strtok? how can i also make a Ban command using BanEx(giveplayerid,reason);
how could i make the reason part work? idk how to do that......
Posts: 1,506
Threads: 69
Joined: Feb 2008
Just take one from any gamemode released on the forums...
Posts: 224
Threads: 28
Joined: Oct 2009
Reputation:
0
the filterscript "base" have this commands /pm /kick /ban
Posts: 1,079
Threads: 64
Joined: Jan 2010
pawn Код:
if(!strcmp("/pm", cmdtext, true))
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,0xFF0000FF,"USAGE: /PM (id) (message)");
new id = strval(tmp);
gMessage = strrest(cmdtext,idx);
if(!strlen(gMessage)) return SendClientMessage(playerid,0xFF0000FF,"Usage: /pm (id) (message)");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"/pm :Invalid ID");
GetPlayerName(id,iName,sizeof(iName));
GetPlayerName(playerid,pName,sizeof(pName));
format(Message,sizeof(Message),">> %s(%i): %s",iName,id,gMessage);
SendClientMessage(playerid,0xFFD720FF,Message);
format(Message,sizeof(Message),"** %s(%i): %s",pName,playerid,gMessage);
SendClientMessage(id,0xFFD720FF,Message);
PlayerPlaySound(id,1085,0.0,0.0,0.0);
return 1;
}
Posts: 305
Threads: 8
Joined: Feb 2009
Reputation:
0
download the sscanf plugin