25.06.2011, 15:50
Hello,
I made something for myself to make things easier: SendFormatCommand (similar to SendFormatMessage).
It seems not to work, while my SendFormatMessage just works fine. This is just adapted from it.
This is where I use it. Below is my /me command, made with ZCMD.
Any idea why it's not working? It doesn't seem there's anything wrong here.
Jochem
Note: Normally, when I just use /me in the chat it works fine. It's not taken from any script or something, I made it myself.
I made something for myself to make things easier: SendFormatCommand (similar to SendFormatMessage).
pawn Код:
new str[128];
#define SendFormatCommand(%0,%1,%2) format(str,sizeof(str),%1,%2) && OnPlayerCommandText(%0,str)
pawn Код:
CMD:windows(playerid,params[])
{
new vehicleid = GetPlayerVehicleID(playerid),modelid = GetVehicleModel(vehicleid);
if(vehicleid != 0)
{
if(VehicleInfo[vehicleid][Windows] == 0)
{
VehicleInfo[vehicleid][Windows] = 1;
SendFormatCommand(playerid,"/me scrolls down the windows of the %s.",vNames[modelid - 400]);
return 1;
}
else if(VehicleInfo[vehicleid][Windows] == 1)
{
VehicleInfo[vehicleid][Windows] = 0;
SendFormatCommand(playerid,"/me scrolls up the windows of the %s.",vNames[modelid - 400]);
return 1;
}
}
else return SendClientMessage(playerid,COLOR_RED,"(( Error: You are not in a vehicle. ))");
return 1;
}
pawn Код:
CMD:me(playerid,params[])
{
if(GetPVarInt(playerid,"IsLogged") == 1)
{
new text[128];
if(!sscanf(params,"s[128]",text))
{
new Float:Pos[3];
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerInRangeOfPoint(i,10,Pos[0],Pos[1],Pos[2]))
{
SendFormatMessage(i,COLOR_LIGHTBLUE,"* %s %s",Playername(playerid),text);
}
}
}
else return SendClientMessage(playerid,COLOR_RED,"(( Syntax Error: /me [Action].");
}
return 1;
}
Jochem
Note: Normally, when I just use /me in the chat it works fine. It's not taken from any script or something, I made it myself.