Going /aod [Admin on Duty]
#1

Hey guys im looking for a filter script that has a cmd, that when you type /aod it Say [My Name] Is now On Duty As An Admin!
Please Guys?!

Thanks
Reply
#2

pawn Код:
#include <a_samp>

public OnPlayerCommandText(playerid, cmdtext[])
{
  new cmd[256];
  new idx;
  cmd = strtok(cmdtext, idx);
 
    if (strcmp(cmd, "/aod", true) == 0)
    {
    if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFFFFAA, "[SERVER]: You are not logged as an administrator!");
    {
    new pName[MAX_PLAYER_NAME];
    new string[256];
  GetPlayerName(playerid, pName, sizeof(pName));
    format(string, sizeof(string), "[%s]: Is now On Duty As An Admin!", pName);
    SendClientMessageToAll(0xFFFF00AA, string);
    }
    return 1;
    }
    return 0;
}

strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
Reply
#3

You didnt search too much i search too much and i findd all i need!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)