20.03.2010, 17:38
pawn Код:
if(strcmp(cmd, "/an", true) == 0)
{
new string[256];
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result)) return SendClientMessage(playerid, COR_BRANCO, "Use: /an [Texto]");
format(string, sizeof(string), "[Anuncio] %s: %s",sendername,result);
SendClientMessageToAll(COR_AMARELO, string);
GivePlayerMoney(playerid,-100);
return 1;
}
//-------------------------[akill]----------------------------------------------
if(strcmp(cmd, "/matar", true) == 0)
{
if(IsPlayerAdmin(playerid))
{
new tmp[256];
tmp = strtok(cmdtext, idx);
new otherplayer = strval(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid, COR_BRANCO, "USO: /matar [playerid]");
if(!IsPlayerConnected(otherplayer)) return SendClientMessage(playerid, COR_BRANCO, "[ID ERRADO]");
SetPlayerHealth(otherplayer, 0);
}
return 1;
}