27.09.2012, 13:22
pawn Код:
// Advertisement system.
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
new AdWait;
forward AdWaitOff();
CMD:ad(playerid, params[])
{
if (AdWait != 0) return SendClientMessage(playerid, 0xAFAFAFFF, "You must wait 30 seconds before posting another ad.");
if (isnull(params))
{
SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /ad [advertisement]");
return 1;
}
new string[152], playername[24];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "Advertisement: %s, Contact: %s", params, playername);
SendClientMessageToAll(0x33AA33FF, string);
AdWait = 1;
SetTimer("AdWaitOff", 30000, false);
GivePlayerMoney(playerid, -50);
SendClientMessage(playerid, 0x33CCFFFF, "You have placed an advertisement. It costed you $50.");
return 1;
}
public AdWaitOff()
{
AdWait = 0;
}