16.04.2018, 09:45
Try this
PHP код:
#define ADV_TIME 120000
CMD:advertise(playerid, params[])
{
new string[128], name[MAX_PLAYER_NAME+1];
if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_CORRECTION, "USAGE: (/ad)vertise [Advert Text]");
if(PlayerInfo[playerid][pAdmin] < 1) return 0;
if(GetPlayerScore <= 1) return SendClientMessage(playerid, COLOR_CORRECTION, "You must be level 2 to place an advertise!");
{
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Advertisement: %s Contact: %s Ph: %d", params, name, PlayerInfo[playerid][Phone]);
SendClientMessageToAll(COLOR_ADVERTISE, string);
GivePlayerMoney(playerid, -1000);
SetTimerEx("AdvertiseWait", ADV_TIME,1, "i", playerid);
}
return 1;
}
forward AdvertiseWait(playerid);
public AdvertiseWait(playerid)
{
new string[100];
format(string, sizeof(string), "Please wait %d seconds for next advertise", ADV_TIME);
SendClientMessage(playerid, COLOR_CORRECTION, string);
}