SendFormatCommand not working
#1

Hello,

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)
It seems not to work, while my SendFormatMessage just works fine. This is just adapted from it.

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;
}
This is where I use it. Below is my /me command, made with ZCMD.

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;
}
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)