13.10.2008, 04:26
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
Please Guys?!
Thanks
#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;
}