Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Snippet Showroom => Topic started by: NeskWriter on March 18, 2013, 07:21:29 pm

Title: Use !afk and go pissing
Post by: NeskWriter 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.
Title: Re: Use !afk and go pissing
Post by: sseebbyy 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.
Title: Re: Use !afk and go pissing
Post by: NeskWriter 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  ;)
Title: Re: Use !afk and go pissing
Post by: sseebbyy 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)

Title: Re: Use !afk and go pissing
Post by: dynavolt71 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.
Title: Re: Use !afk and go pissing
Post by: sseebbyy 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~
Title: Re: Use !afk and go pissing
Post by: rohanaj60 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.