/ad script
#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


Messages In This Thread
/ad script - by pakos - 14.11.2009, 17:12
Re: /ad script - by MJ! - 14.11.2009, 18:44
Re: /ad script - by Correlli - 14.11.2009, 18:50
Re: /ad script - by CuervO - 15.11.2009, 07:06
Re: /ad script - by saiberfun - 15.11.2009, 08:30
Re: /ad script - by pakos - 15.11.2009, 09:21
Re: /ad script - by Correlli - 15.11.2009, 10:14
Re: /ad script - by dirkblok - 15.11.2009, 10:21
Re: /ad script - by CuervO - 15.11.2009, 16:51

Forum Jump:


Users browsing this thread: 1 Guest(s)