Going /aod [Admin on Duty]
#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


Messages In This Thread
Going /aod [Admin on Duty] - by haraki255 - 13.10.2008, 04:26
Re: Going /aod [Admin on Duty] - by Vladis - 13.10.2008, 05:20
Re: Going /aod [Admin on Duty] - by James_Bauer - 15.08.2009, 07:34

Forum Jump:


Users browsing this thread: 1 Guest(s)