/aooc?
#1

Hey!, I made this code for Rcon admin untill I get my Admin system, It saneds this "Admin Name:" Whic his what I want it to send but I want to send a message also E.g If I type "LOL" I want it to send that.

pawn Код:
if (strcmp("/aooc", cmdtext, true, 10) == 0)
    {
        IsPlayerAdmin(playerid);
        if(!strlen(cmdtext)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /aooc [chat]");
        new str[128];
        GetPlayerName(playerid, str, sizeof(str));
        format(str, sizeof(str), "Admin %s: %s", str, cmdtext);
        SendClientMessageToAll(COLOR_GOLD, str);
        return 1;
    }
Reply
#2

Код:
if (strcmp("/aooc", cmdtext, true, 10) == 0)
    {
        IsPlayerAdmin(playerid);
        if(!strlen(cmdtext)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /aooc [chat]");
        new str[128];
        GetPlayerName(playerid, str, sizeof(str));
        format(str, sizeof(str), "Admin %s: %s", GetPlayerName(playerid), cmdtext);
        SendClientMessageToAll(COLOR_GOLD, str);
        return 1;
    }
I ain't sure if it's it, i'm to tired to even type but i thought i'd give it a go.
Reply
#3

if (strcmp("/aooc", cmdtext, true, 5) == 0)
{
IsPlayerAdmin(playerid);
if(!strlen(cmdtext)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /aooc [chat]");
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "Admin %s: %s", str, cmdtext);
SendClientMessageToAll(COLOR_GOLD, str);
return 1;
}
Reply
#4

Nah sorry none of them work..
Reply
#5

try creating a new name[MAX_PLAYER_NAME]; then use GetPlayerName(playerid,name,sizeof(name));
and when you format it change the GetPlayerName(playerid) to name
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)