Need advertisement script !
#1

I need advertisement script like in RP. can who help me ?
THANK YOU VERY MUCH!
Reply
#2

this helps ?

pawn Код:
forward RandomAnnounce();
and

pawn Код:
new RandomText[5][0] = { // where the 5 is edit this to the number of the random text
{"hello"},
{"hello"},
{"hello"},
{"hello"},
{"hello"} // the last one with out a ,
};
and this at ongamemodeinit
pawn Код:
SetTimer("RandomAnnounce", 180000, true); // 3 Minutes
Reply
#3

Quote:
Originally Posted by radi
this helps ?

pawn Код:
forward RandomAnnounce();
and

pawn Код:
new RandomText[5][0] = { // where the 5 is edit this to the number of the random text
{"hello"},
{"hello"},
{"hello"},
{"hello"},
{"hello"} // the last one with out a ,
};
and this at ongamemodeinit
pawn Код:
SetTimer("RandomAnnounce", 180000, true); // 3 Minutes
this...
command: /ad
like this http://forum.sa-mp.com/index.php?topic=71698.0
but I cant edit this for my GM
Reply
#4

this is a message that every time appears
if you set it on 3 min
every 3 min it will apears
it wil randomly pick a line of what you typed
Reply
#5

or like this ?

pawn Код:
if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0)
    {
        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_PURPLE, "USAGE: (/ad)vertise [advert text]");
            return 1;
        }
        if ((noooc) && (PlayerInfo[playerid][pAdmin] < 1))
        {
            SendClientMessage(playerid, COLOR_PURPLE, "  the advertisment chanel has been disabled by admin");
            return 1;
        }
        if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
        {
            format(string, sizeof(string), "  Please try again later %d seconds between adverts", (addtimer/1000));
            SendClientMessage(playerid, COLOR_PURPLE, string);
            return 1;

        }
        if(Mute[playerid] == 0)
        {
        format(string, sizeof(string), "Advertisement: %s, Contact: %s Ph: %d", result, sendername,PlayerInfo[playerid][pPnumber]);
        OOCOff(TEAM_GROVE_COLOR,string);
        }
        else
        {
        SendClientMessage(playerid, COLOR_RED, "You cannot use /ad if you're muted.");
        }
        if (PlayerInfo[playerid][pAdmin] < 1)
        {
        SetTimer("AddsOn", addtimer, 0);
        adds = 0;
        }
        return 1;
    }
?
Reply
#6

Quote:
Originally Posted by radi
or like this ?

pawn Код:
if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0)
    {
        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_PURPLE, "USAGE: (/ad)vertise [advert text]");
            return 1;
        }
        if ((noooc) && (PlayerInfo[playerid][pAdmin] < 1))
        {
            SendClientMessage(playerid, COLOR_PURPLE, "  the advertisment chanel has been disabled by admin");
            return 1;
        }
        if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
        {
            format(string, sizeof(string), "  Please try again later %d seconds between adverts", (addtimer/1000));
            SendClientMessage(playerid, COLOR_PURPLE, string);
            return 1;

        }
        if(Mute[playerid] == 0)
        {
        format(string, sizeof(string), "Advertisement: %s, Contact: %s Ph: %d", result, sendername,PlayerInfo[playerid][pPnumber]);
        OOCOff(TEAM_GROVE_COLOR,string);
        }
        else
        {
        SendClientMessage(playerid, COLOR_RED, "You cannot use /ad if you're muted.");
        }
        if (PlayerInfo[playerid][pAdmin] < 1)
        {
        SetTimer("AddsOn", addtimer, 0);
        adds = 0;
        }
        return 1;
    }
?
Easy to copy from the GF.
Reply
#7

Quote:
Originally Posted by MenaceX^
Quote:
Originally Posted by radi
or like this ?

pawn Код:
if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0)
    {
        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_PURPLE, "USAGE: (/ad)vertise [advert text]");
            return 1;
        }
        if ((noooc) && (PlayerInfo[playerid][pAdmin] < 1))
        {
            SendClientMessage(playerid, COLOR_PURPLE, "  the advertisment chanel has been disabled by admin");
            return 1;
        }
        if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
        {
            format(string, sizeof(string), "  Please try again later %d seconds between adverts", (addtimer/1000));
            SendClientMessage(playerid, COLOR_PURPLE, string);
            return 1;

        }
        if(Mute[playerid] == 0)
        {
        format(string, sizeof(string), "Advertisement: %s, Contact: %s Ph: %d", result, sendername,PlayerInfo[playerid][pPnumber]);
        OOCOff(TEAM_GROVE_COLOR,string);
        }
        else
        {
        SendClientMessage(playerid, COLOR_RED, "You cannot use /ad if you're muted.");
        }
        if (PlayerInfo[playerid][pAdmin] < 1)
        {
        SetTimer("AddsOn", addtimer, 0);
        adds = 0;
        }
        return 1;
    }
?
Easy to copy from the GF.
Yes This I need.. but I get an errors


Код:
C:\Documents and Settings\Metka\My Documents\samp-server\gamemodes\GM.pwn(13170) : warning 217: loose indentation
C:\Documents and Settings\Metka\My Documents\samp-server\gamemodes\GM.pwn(13170) : error 017: undefined symbol "cmd"
C:\Documents and Settings\Metka\My Documents\samp-server\gamemodes\GM.pwn(13172) : error 017: undefined symbol "sendername"
C:\Documents and Settings\Metka\My Documents\samp-server\gamemodes\GM.pwn(13172) : error 017: undefined symbol "sendername"
C:\Documents and Settings\Metka\My Documents\samp-server\gamemodes\GM.pwn(13172) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Metka\My Documents\samp-server\gamemodes\GM.pwn(13172) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#8

An example using dcmd:

Код:
dcmd_ad( playerid, params[ ] )
{
  if( !strlen ( params ) ) 
    return SendClientMessage ( playerid, 0xFFFFFFAA, "Syntax: /ad [advertisement]" );

  if( strlen( params ) < 2 )
    return SendClientMessage( playerid, 0xFFFFFFAA, "Your advertisement is not long enough." );

  new szAdMsg[128];
  format( szAdMsg, 128, "Advertisement: %s", params );
  SendClientMessageToAll( 0xFFFFFFAA, szAdMsg );
  return 1;
}
For more information about dcmd visit https://sampwiki.blast.hk/wiki/Dcmd
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)