CMD Wont work
#1

My Command doesnt work ingame and no compile errors :O
pawn Код:
CMD:aooc(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new sendername[MAX_PLAYER_NAME], string[56];
        GetPlayerName(playerid, sendername, sizeof(sendername));
        if(isnull(params)) return SendClientMessage(playerid, 0xFFFFFFF,"Syntax error.Correct usage: /ooc [text]");
        format(string, sizeof(string), "{00FF00}(( {FFFFFF}%s: %s {00FF00}))", sendername, params);
        SendClientMessageToAll(0xFFFFFFF, string);
    }
    else
    {
    SendClientMessage(playerid, 0xFF00FF, "[Admin] Sorry you are not a administrator!");
    }
    return 1;
}
Reply
#2

You want this to work when your logged into the RCON?
Reply
#3

pawn Код:
CMD:aooc(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new sendername[MAX_PLAYER_NAME], string[56];
        GetPlayerName(playerid, sendername, sizeof(sendername));
        if(sscanf(params,"s[56]",string)) return SendClientMessage(playerid, 0xFFFFFFF,"Syntax error.Correct usage: /ooc [text]");
        format(string, sizeof(string), "{00FF00}(( {FFFFFF}%s: %s {00FF00}))", sendername, params);
        SendClientMessageToAll(0xFFFFFFF, string);
    }
    else SendClientMessage(playerid, 0xFF00FF, "[Admin] Sorry you are not a administrator!");
  return 1;
}
Try it like that.
Reply
#4

Quote:
Originally Posted by Cjgogo
Посмотреть сообщение
pawn Код:
CMD:aooc(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new sendername[MAX_PLAYER_NAME], string[56];
        GetPlayerName(playerid, sendername, sizeof(sendername));
        if(sscanf(params,"s[56]",string)) return SendClientMessage(playerid, 0xFFFFFFF,"Syntax error.Correct usage: /ooc [text]");
        format(string, sizeof(string), "{00FF00}(( {FFFFFF}%s: %s {00FF00}))", sendername, params);
        SendClientMessageToAll(0xFFFFFFF, string);
    }
    else SendClientMessage(playerid, 0xFF00FF, "[Admin] Sorry you are not a administrator!");
  return 1;
}
Try it like that.
I'll try, I am trying to make a freeroam script.

Any tutorials on making factions + a request cmd to requst to join a faction?

EDIT: It wont say my text

EDIT2: I'l try again, I didnt add sscanf plugin XDD

EDIT3: Didnt work, doesn't say my text
Reply
#5

change the string size to 128 (56 is really small, you're already using 47 by the time you get to the players text)


also...You don't need sscanf for this, you can use what you already had.
Reply
#6

Quote:
Originally Posted by [ABK]Antonio
Посмотреть сообщение
change the string size to 128 (56 is really small, you're already using 47 by the time you get to the players text)


also...You don't need sscanf for this, you can use what you already had.
It won't work just syas Syntyax error all the time when /aooc test
Reply
#7

pawn Код:
CMD:aooc(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new sendername[MAX_PLAYER_NAME], string[512],message[256];
        GetPlayerName(playerid, sendername, sizeof(sendername));
        if(sscanf(params,"s[256]",message)) return SendClientMessage(playerid, 0xFFFFFFF,"Syntax error.Correct usage: /ooc [text]");
        format(string, sizeof(string), "{00FF00}(( {FFFFFF}%s: %s {00FF00}))", sendername, message);
        SendClientMessageToAll(0xFFFFFFF, string);
    }
    else SendClientMessage(playerid, 0xFF00FF, "[Admin] Sorry you are not a administrator!");
  return 1;
}
Try it like that,you had no string defined for the message you were about to send
Reply
#8

pawn Код:
CMD:aooc(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        if(isnull(params)) return SendClientMessage(playerid, 0xFFFFFFFF,"Syntax error.Correct usage: /ooc [text]");
        new sendername[MAX_PLAYER_NAME], string[128];
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string), "{00FF00}(( {FFFFFF}%s: %s {00FF00}))", sendername, params);
        SendClientMessageToAll(0xFFFFFFAA, string);
    }
    else return SendClientMessage(playerid, 0xFF00FFAA, "[Admin] Sorry you are not a administrator!");
    return 1;
}
To above...He has a string already, it's called params...

/aooc THIS IS THE PARAMS
Reply
#9

Just try my way first,and congratulatione Antonio for posting the same thing 5 players already did,and sanplayer claimed didn't work,keep the good job on
Reply
#10

Quote:
Originally Posted by Cjgogo
Посмотреть сообщение
pawn Код:
CMD:aooc(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new sendername[MAX_PLAYER_NAME], string[512],message[256];
        GetPlayerName(playerid, sendername, sizeof(sendername));
        if(sscanf(params,"s[256]",message)) return SendClientMessage(playerid, 0xFFFFFFF,"Syntax error.Correct usage: /ooc [text]");
        format(string, sizeof(string), "{00FF00}(( {FFFFFF}%s: %s {00FF00}))", sendername, message);
        SendClientMessageToAll(0xFFFFFFF, string);
    }
    else SendClientMessage(playerid, 0xFF00FF, "[Admin] Sorry you are not a administrator!");
  return 1;
}
Try it like that,you had no string defined for the message you were about to send
nope,

Why can no-one fix this xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)