31.05.2010, 09:06
Thanks both helped alot, ill have to read more documentation on sscanf thanks again
EDIT: btw im using sscanf2 and 'z' is depreciated. or so it says on the console window. just edited title sorry.
Just incase people need this in future here is the code for PM's that works for sscanf2.
EDIT: btw im using sscanf2 and 'z' is depreciated. or so it says on the console window. just edited title sorry.
Just incase people need this in future here is the code for PM's that works for sscanf2.
pawn Код:
COMMAND:pm(playerid,params[])
{
new ID;
new PMstring[128];//the PM
new string[128];//string used for SendClientMessage
new Iname[MAX_PLAYER_NAME], Pname[MAX_PLAYER_NAME];
if (sscanf(params, "ds[128]", ID, PMstring))
{
SendClientMessage(playerid,red,"Usage: /pm (id) (message)");
return 1;
}
GetPlayerName(ID,Iname,sizeof(Iname));
GetPlayerName(playerid,Pname,sizeof(Pname));
format(string,128,"PM from %i[%s]: %s",playerid,Pname,PMstring);
SendClientMessage(ID,0xFFD720FF,string);
format(string,128,"PM To %s: %s",Iname,PMstring);
SendClientMessage(playerid,0xFFD720FF,string);
PlayerPlaySound(ID,1085,0.0,0.0,0.0);
return 1;
}