Author Topic: Use !afk and go pissing  (Read 5342 times)

0 Members and 2 Guests are viewing this topic.

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Use !afk and go pissing
« on: March 18, 2013, 07:21:29 pm »
Hello! This is simple script which guarantees you protection of your player while you're pissing (OOC) ;).
All you need is just to paste this code:

In the beginning:
[pawn]
new playerisafk[MAX_PLAYERS];
new Float:px, Float:py, Float:pz;
[/pawn]

In public OnPlayerText(playerid, text[])
[pawn]

    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
   if(strfind(text, "!afk", true, 0) != -1)
   {
      if(!playerisafk[playerid])
      {
           GetPlayerPos(playerid, px, py, pz);
          new string[256];
          format(string, sizeof(string), "%s is now AFK (Away from keyboard).", pname);
          SendClientMessageToAll(0xFF875AA, string);
          SetPlayerPos(playerid, 474.23223, -1717.48022, 62.5, 135, 0); // change date coords on your own (I've made it lighthouse's rooftop for a standart ;).
          TogglePlayerControllable(playerid, 0);
          playerisafk[playerid]=1;
      }
      else
      {
          SendClientMessage(playerid, 0xFF0000AA, "You are still in the AFK mode.");
      }
      return 1;
   }
   else if(strfind(text, "!back", true, 0) != -1)
   {
      if(!playerisafk[playerid])
      {
          SendClientMessage(playerid, 0xFF0000AA, "You are not in the AFK mode.");
      }
      else
      {
          new string2[256];
          format(string2, sizeof(string2), "%s is now Back", pname);
          SendClientMessageToAll(0xFF875AA, string2);
          SetPlayerPos(playerid, px, py, pz, 0, 0);
          TogglePlayerControllable(playerid, 1);
          playerisafk[playerid]=0;
      }
      return 1;
   }
[/pawn]

I tried to make it mo' advanced, so:
1st. You can't use !afk if you're already afk - it is for anti-abusing, 4 example, flooding.
2nd. You can't use !back if you aren't afk - specially for old people with sclerosis.
3rd. !back will return you to the place whr you used !afk.

Dank je voor uw aandacht  :D.
« Last Edit: March 18, 2013, 09:30:35 pm by NeskWriter »


-Funniest quotes-

Quote from: asad3man
i cant able to understand

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: Use !afk and go pissing
« Reply #1 on: March 18, 2013, 08:56:01 pm »
It is simple and good enough, but maybe you can change the coords to a secret room/place 'cause on the lighthouse's roof is not enough space + when you freeze the player, it can be killed with shotguns.

Is nothing "Advanced" in a !afk system, is just a simple thing.

PS: I think this topic should be moved to the Snippet Board.

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: Use !afk and go pissing
« Reply #2 on: March 18, 2013, 09:34:58 pm »
It is simple and good enough, but maybe you can change the coords to a secret room/place 'cause on the lighthouse's roof is not enough space + when you freeze the player, it can be killed with shotguns.

Is nothing "Advanced" in a !afk system, is just a simple thing.

PS: I think this topic should be moved to the Snippet Board.

I didn't call it a secret room :D. Let the user set the secret place by his own, plus, shotguns of VC are used only for targets that are located nearby. "Advanced" is the function that let the user be returned to the coords that have been taken when he typed "!afk", and system that works like a little anti-abusing machine.
Anyway, thank you for your comment and opinion. Maybe, I'll make it mo' better, if I'll find mo' free time  ;)


-Funniest quotes-

Quote from: asad3man
i cant able to understand

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: Use !afk and go pissing
« Reply #3 on: March 18, 2013, 10:39:31 pm »
I didn't call it a secret room :D.

Did I say that you called it a secret room ? Not.

Let the user set the secret place by his own, plus, shotguns of VC are used only for targets that are located nearby.

If you wanted to release a good example, you could add some good coords for a good place.
And about the shotgun, how hard can be to land a helicopter on the roof of the lighthouse and just wait for some targets ? Not so hard.

"Advanced" is the function that let the user be returned to the coords that have been taken when he typed "!afk", and system that works like a little anti-abusing machine.

For me, adding some anti-abusing variables is something standard.
But I appreciate that you save the player pos before him is teleported to the afk place, and return it back when it is back.:P (I'm returning the player too in my server)


Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline dynavolt71

  • Crime Boss
  • ****
  • Posts: 371
    • View Profile
    • My Blog
Re: Use !afk and go pissing
« Reply #4 on: March 19, 2013, 01:44:56 am »
Wait...
if player use this maybe this is for goto
Example : plyr 1 want go to plyr2 but it so long so plyr 1 use AFK to goto plyr2.
[PAWNO]Fix Error " Failed to set data for "" " - http://forum.vicecitymultiplayer.com/index.php?topic=5743.0



:'(

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: Use !afk and go pissing
« Reply #5 on: March 19, 2013, 04:07:14 pm »
Wait...
if player use this maybe this is for goto
Example : plyr 1 want go to plyr2 but it so long so plyr 1 use AFK to goto plyr2.

Good point !
Hmmm, I didn't noticed that... the floats are for all players...

You should do personal variables that save the pos of a player.

Example:
Code: [Select]
new afkx[MAX_PLAYERS];
new afky[MAX_PLAYERS];
new afkz[MAX_PLAYERS];

~then set values for them~

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline rohanaj60

  • Street Thug
  • *
  • Posts: 27
  • I am a great scripter :D
    • View Profile
Re: Use !afk and go pissing
« Reply #6 on: March 17, 2014, 03:02:20 pm »
Hello! This is simple script which guarantees you protection of your player while you're pissing (OOC) ;).
All you need is just to paste this code:

In the beginning:
[pawn]
new playerisafk[MAX_PLAYERS];
new Float:px, Float:py, Float:pz;
[/pawn]

In public OnPlayerText(playerid, text[])
[pawn]

    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
   if(strfind(text, "!afk", true, 0) != -1)
   {
      if(!playerisafk[playerid])
      {
           GetPlayerPos(playerid, px, py, pz);
          new string[256];
          format(string, sizeof(string), "%s is now AFK (Away from keyboard).", pname);
          SendClientMessageToAll(0xFF875AA, string);
          SetPlayerPos(playerid, 474.23223, -1717.48022, 62.5, 135, 0); // change date coords on your own (I've made it lighthouse's rooftop for a standart ;).
          TogglePlayerControllable(playerid, 0);
          playerisafk[playerid]=1;
      }
      else
      {
          SendClientMessage(playerid, 0xFF0000AA, "You are still in the AFK mode.");
      }
      return 1;
   }
   else if(strfind(text, "!back", true, 0) != -1)
   {
      if(!playerisafk[playerid])
      {
          SendClientMessage(playerid, 0xFF0000AA, "You are not in the AFK mode.");
      }
      else
      {
          new string2[256];
          format(string2, sizeof(string2), "%s is now Back", pname);
          SendClientMessageToAll(0xFF875AA, string2);
          SetPlayerPos(playerid, px, py, pz, 0, 0);
          TogglePlayerControllable(playerid, 1);
          playerisafk[playerid]=0;
      }
      return 1;
   }
[/pawn]

I tried to make it mo' advanced, so:
1st. You can't use !afk if you're already afk - it is for anti-abusing, 4 example, flooding.
2nd. You can't use !back if you aren't afk - specially for old people with sclerosis.
3rd. !back will return you to the place whr you used !afk.

Dank je voor uw aandacht  :D.