Author Topic: How to make the game ads  (Read 3336 times)

0 Members and 1 Guest are viewing this topic.

Offline dream

  • Street Thug
  • *
  • Posts: 7
    • View Profile
How to make the game ads
« on: February 17, 2013, 09:34:26 am »
plz help me :)
Sorry for my bad English

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: How to make the game ads
« Reply #1 on: February 17, 2013, 11:34:25 am »
Can u write details here? I mean, what u need, how it should work and what format it must have


-Funniest quotes-

Quote from: asad3man
i cant able to understand

Offline mrockxkingbutt

  • Crime Boss
  • ****
  • Posts: 373
  • I AM Best Scripter And You Are Not :P
    • View Profile
Re: How to make the game ads
« Reply #2 on: February 17, 2013, 03:48:43 pm »
Here
[pawn]     else if ( strcmp( cmd, "news", true ) == 0 )
   {
      tmp = strtok( cmdtext, idx );
      if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
      else if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, COLOR_RED, "You don't have access to use this command!" );
      else if ( !strlen( tmp ) ) { SendClientMessage( playerid, COLOR_GREEN, "USAGE: /c news [Message]" ); }
      else
      {
         new szMsg[ 128 ];
         format( szMsg, 128, "News By %s : %s", gPlayers[ playerid ], cmdtext[ 3 ] );
         SendClientMessageToAll( RED, szMsg );
      }
      return 1;
      } [/pawn]
you just have to write /c news like news by spider join the server visit our forum etc

i have one more which can save your news
[pawn]      else if (strcmp(cmd, "setnews", true) == 0) {
      new setnews[256];
      tmp = strtok(cmdtext, idx);
      if(!IsPlayerAdmin(playerid)) SendClientMessage(playerid, COLOR_RED, "You need to Rcon login first!");
      else if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED,"USAGE: /c setnews text");
      else {
         format(file, sizeof(file), "/News/News.ini", "News");
            format(setnews,sizeof(setnews),"By [%s]> %s ",gPlayers[playerid],cmdtext[7]);
         dini_Set(file, "News", setnews);
      }
      return 1;
   }[/pawn]
timer
[pawn]SetTimer("DisplayNews",1000*60*1,1);[/pawn]
public
[pawn]public DisplayNews()
{
new Msg[256];
      new xgv[256];
   format(file, sizeof(file), "/News/News.ini");
   xgv = dini_Get(file, "News");
   
          format(Msg,sizeof(Msg),"News>:%s",xgv);
         SendClientMessageToAll(COLOR_YELLOW, Msg);

}[/pawn]
you have to make a folder
News and in folder News.ini
good luck
« Last Edit: February 17, 2013, 03:51:36 pm by mrockxkingbutt »
My Servers Showroom!
www.jimxvcmpscripts.createaforum.com/

Quote from:  rohanaj60
i m a great script Editor

Rofl! lmao lol

Offline dream

  • Street Thug
  • *
  • Posts: 7
    • View Profile
Re: How to make the game ads
« Reply #3 on: February 17, 2013, 04:27:15 pm »
Here
[pawn]     else if ( strcmp( cmd, "news", true ) == 0 )
   {
      tmp = strtok( cmdtext, idx );
      if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
      else if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, COLOR_RED, "You don't have access to use this command!" );
      else if ( !strlen( tmp ) ) { SendClientMessage( playerid, COLOR_GREEN, "USAGE: /c news [Message]" ); }
      else
      {
         new szMsg[ 128 ];
         format( szMsg, 128, "News By %s : %s", gPlayers[ playerid ], cmdtext[ 3 ] );
         SendClientMessageToAll( RED, szMsg );
      }
      return 1;
      } [/pawn]
you just have to write /c news like news by spider join the server visit our forum etc

i have one more which can save your news
[pawn]      else if (strcmp(cmd, "setnews", true) == 0) {
      new setnews[256];
      tmp = strtok(cmdtext, idx);
      if(!IsPlayerAdmin(playerid)) SendClientMessage(playerid, COLOR_RED, "You need to Rcon login first!");
      else if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED,"USAGE: /c setnews text");
      else {
         format(file, sizeof(file), "/News/News.ini", "News");
            format(setnews,sizeof(setnews),"By [%s]> %s ",gPlayers[playerid],cmdtext[7]);
         dini_Set(file, "News", setnews);
      }
      return 1;
   }[/pawn]
timer
[pawn]SetTimer("DisplayNews",1000*60*1,1);[/pawn]
public
[pawn]public DisplayNews()
{
new Msg[256];
      new xgv[256];
   format(file, sizeof(file), "/News/News.ini");
   xgv = dini_Get(file, "News");
   
          format(Msg,sizeof(Msg),"News>:%s",xgv);
         SendClientMessageToAll(COLOR_YELLOW, Msg);

}[/pawn]
you have to make a folder
News and in folder News.ini
good luck
Thanks!!!
Sorry for my bad English

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: How to make the game ads
« Reply #4 on: February 17, 2013, 05:58:40 pm »
Here
[pawn]     else if ( strcmp( cmd, "news", true ) == 0 )
   {
      tmp = strtok( cmdtext, idx );
      if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
      else if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, COLOR_RED, "You don't have access to use this command!" );
      else if ( !strlen( tmp ) ) { SendClientMessage( playerid, COLOR_GREEN, "USAGE: /c news [Message]" ); }
      else
      {
         new szMsg[ 128 ];
         format( szMsg, 128, "News By %s : %s", gPlayers[ playerid ], cmdtext[ 3 ] );
         SendClientMessageToAll( RED, szMsg );
      }
      return 1;
      } [/pawn]
you just have to write /c news like news by spider join the server visit our forum etc

i have one more which can save your news
[pawn]      else if (strcmp(cmd, "setnews", true) == 0) {
      new setnews[256];
      tmp = strtok(cmdtext, idx);
      if(!IsPlayerAdmin(playerid)) SendClientMessage(playerid, COLOR_RED, "You need to Rcon login first!");
      else if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED,"USAGE: /c setnews text");
      else {
         format(file, sizeof(file), "/News/News.ini", "News");
            format(setnews,sizeof(setnews),"By [%s]> %s ",gPlayers[playerid],cmdtext[7]);
         dini_Set(file, "News", setnews);
      }
      return 1;
   }[/pawn]
timer
[pawn]SetTimer("DisplayNews",1000*60*1,1);[/pawn]
public
[pawn]public DisplayNews()
{
new Msg[256];
      new xgv[256];
   format(file, sizeof(file), "/News/News.ini");
   xgv = dini_Get(file, "News");
   
          format(Msg,sizeof(Msg),"News>:%s",xgv);
         SendClientMessageToAll(COLOR_YELLOW, Msg);

}[/pawn]
you have to make a folder
News and in folder News.ini
good luck

Y U EVER USE TIMER? Can u make cmds above the timers? You don't need to set timer here, man.


-Funniest quotes-

Quote from: asad3man
i cant able to understand

Offline mrockxkingbutt

  • Crime Boss
  • ****
  • Posts: 373
  • I AM Best Scripter And You Are Not :P
    • View Profile
Re: How to make the game ads
« Reply #5 on: February 17, 2013, 06:49:53 pm »
i setted timer becuz if you setnews
the timer shows you news every minute
My Servers Showroom!
www.jimxvcmpscripts.createaforum.com/

Quote from:  rohanaj60
i m a great script Editor

Rofl! lmao lol

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: How to make the game ads
« Reply #6 on: February 17, 2013, 09:13:50 pm »
i setted timer becuz if you setnews
the timer shows you news every minute

As people said before, use SetTimer only in OnGameModeInit


-Funniest quotes-

Quote from: asad3man
i cant able to understand