15.11.2009, 16:51
pawn Code:
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_ORANGE 0xFF9900AA
pawn Code:
forward AddsOn();
pawn Code:
if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0)
{
if(IsPlayerConnected(playerid))
{
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))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/ad)vertise [advert text]");
return 1;
}
if ((!adds))
{
format(string, sizeof(string), "** Please try again later %d seconds between Advertisements !", (addtimer/1000));
SendClientMessage(playerid, COLOR_GRAD2, string);
return 1;
}
GivePlayerMoney(playerid, - 50);
format(string, sizeof(string), "ADVERTISEMENT: %s, contact %s", result, sendername);
SendClientMessageToAll(COLOR_ORANGE,string);
GameTextForPlayer(playerid, "~w~Advertisement ~n~~w~Price:~g~$50", 4321,1);
SetTimer("AddsOn", addtimer, 0);
adds = 0;
}
return 1;
}
Compiled without errors at teh SAGC // Did you just noticed that SAGC has another /ad command?, Go to line 16526 or Search for "/ad", comment it and my /ad will work