14.11.2009, 17:12
Hi can anyone put script for command /ad and /advertisement ?
whit 60 sec space before next ad?
whit 60 sec space before next ad?
forward AddsOn();
new adds = 1;
new addtimer = 60000;
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;
}
public AddsOn()
{
adds=1;
return 1;
}
Originally Posted by CueЯvo
p.s: It costs 50$
|
Originally Posted by CueЯvo
pawn Code:
pawn Code:
pawn Code:
pawn Code:
This will basically do an advertise on the whole server, and no one will be allowed to do another advertise within 60 seconds, if you want to remove that 60 seconds for everyone protection, edit or contact me. p.s: It costs 50$ |
Originally Posted by ┤ŞąiBЄЯҒПŋ├
Quote:
u wanna be paid for sum snippet? XD |
Originally Posted by pakos
Quote:
If you are not a problem, please create /ad command but for this gamemode =) |
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_ORANGE 0xFF9900AA
forward AddsOn();
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;
}