/ad script
#1

Hi can anyone put script for command /ad and /advertisement ?
whit 60 sec space before next ad?
Reply
#2

You can find it in gf.pwn
Reply
#3

http://forum.sa-mp.com/index.php?action=search
Reply
#4

pawn Code:
forward AddsOn();
pawn Code:
new adds = 1;
new addtimer = 60000;
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;
    }
pawn Code:
public AddsOn()
{
    adds=1;
    return 1;
}
_________________________________________________

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$
Reply
#5

Quote:
Originally Posted by CueЯvo
p.s: It costs 50$
lol what? XD
u wanna be paid for sum snippet? XD
Reply
#6

Quote:
Originally Posted by CueЯvo
pawn Code:
forward AddsOn();
pawn Code:
new adds = 1;
new addtimer = 60000;
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;
    }
pawn Code:
public AddsOn()
{
    adds=1;
    return 1;
}
_________________________________________________

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$
this code does not work on [GM] [0.3a] SAGC Roleplay (Revision 2) (23035 Lines)

If you are not a problem, please create /ad command but for this gamemode =)
Reply
#7

Quote:
Originally Posted by ┤ŞąiBЄЯҒПŋ├
Quote:
Originally Posted by CueЯvo
p.s: It costs 50$
lol what? XD
u wanna be paid for sum snippet? XD
No, check the code. I takes $50 from the player.
Reply
#8

Quote:
Originally Posted by pakos
Quote:
Originally Posted by CueЯvo
pawn Code:
forward AddsOn();
pawn Code:
new adds = 1;
new addtimer = 60000;
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;
    }
pawn Code:
public AddsOn()
{
    adds=1;
    return 1;
}
_________________________________________________

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$
this code does not work on [GM] [0.3a] SAGC Roleplay (Revision 2) (23035 Lines)

If you are not a problem, please create /ad command but for this gamemode =)
Why won't this work... It's good I think .
Reply
#9

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)