Problem with isnull and sscanf, returning unknown command.
#6

Hello Connor.

Those will work!

PHP код:
CMD:me(playeridparams[])
{
    new
        
string[128],
        
action[100];
    if(
sscanf(params"s[100]"action))
    {
        
SendClientMessage(playerid, -1"USAGE: /me [action]");
        return 
1;
    }
    else
    {
        
format(stringsizeof(string), "* %s %s"GetName(playerid), action);
        
ProxDetector(30playeridstring0xFF80FFC8);
    }
    return 
1;

PHP код:
CMD:pm(playeridparams[])
{
    new 
str[256], str2[256], idName1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
    if(
sscanf(params"us"idstr2))
    {
        
SendClientMessage(playerid0xFFFF00C8"Usage: /pm <id> <message>");
        return 
1;
    }
    if(!
IsPlayerConnected(id)) return SendClientMessage(playerid0xFFFF00C8"ERROR: Player not connected");
    if(
playerid == id) return SendClientMessage(playerid0xFFFF00C8"ERROR: You cannot pm yourself!");
    {
        
GetPlayerName(playeridName1sizeof(Name1));
        
GetPlayerName(idName2sizeof(Name2));
        
format(strsizeof(str), "PM To %s(ID %d): %s"Name2idstr2);
        
SendClientMessage(playerid0xFFFF00C8str);
        
format(strsizeof(str), "PM From %s(ID %d): %s"Name1playeridstr2);
        
SendClientMessage(id0xFFFF00C8str);
    }
    return 
1;

Your /act a.k.a /do command is bugged because of /act and /me is using the exactly same code. You cannot make TWO commands with same texts. I didn't fix anything in your /act command. Just saying.


PHP код:
CMD:act(playeridparams[]) // BUGGED
{
    new
        
string[128],
        
action[100];
    if(
sscanf(params"s[100]"action))
    {
        
SendClientMessage(playerid, -1"USAGE: {FFFFFF}/act [action]");
        return 
1;
    }
    else
    {
        
format(stringsizeof(string), "* %s %s.",(playerid), action);
        
ProxDetector(30playeridstringCOLOR_PURPLE);
    }
    return 
1;

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)