Author Topic: Want to slap someone ? :D  (Read 3217 times)

0 Members and 1 Guest are viewing this topic.

Offline JaVeD

  • Street Thug
  • *
  • Posts: 46
  • Want scripts? Pm me now! Just for $
    • View Profile
    • Free Host -> Clicky
Want to slap someone ? :D
« on: February 11, 2013, 06:27:47 am »
New slap command i hope u guys like it :- if you have this command so sorry if someone dont have this command enjoy with slapping ahhahahahaxD  ::)

[pawn]else if ( strcmp( cmd, "slap", true ) == 0 )
   {
      new reason[ 256 ], plr;
      IsPlayerAdmin(playerid);
      tmp = strtok( cmdtext, idx ), reason = strtok( cmdtext, idx ), plr = FindPlayerIDFromString( tmp );
      if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, GREEN, "Please log-in to your account." );
      else if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, BLUE, "You don't have access to use this command!" );
      else if ( !strlen(reason) ) SendClientMessage( playerid, COLOR_RED, "USAGE: /c slap [Nick/ID] [Reason]" );
        else if ( plr == INACTIVE_PLAYER_ID ) SendClientMessage( playerid, COLOR_RED, "Error: Unknown player" );
      else
      {
            new Float:x, Float:y, Float:z, szMsg[ 128 ];
          GetPlayerPos( plr, x, y, z );
         SetPlayerPos( plr, x+30, y+10, z+20, 0, 0 );
         format( szMsg, sizeof( szMsg ), "Administrator %s slaped player %s Reason:[ %s ]", gPlayers[ playerid ], gPlayers[ plr ], cmdtext[ strlen( tmp ) +6 ] );
         SendClientMessageToAll( BLUE, szMsg );
         GameTextForPlayer (plr, " You ~p~Have ~b~been ~o~slaped ");
         SetPlayerDrunk(plr, 300, 300);
      }
      return 1;

      }[/pawn]
SA:MP Server: 5.231.49.21:7777
Website: www.nse-server.com

Offline Fuzzy168

  • VC:MP Veteran
  • *****
  • Posts: 729
  • Programming since 2011
    • View Profile
Re: Want to slap someone ? :D
« Reply #1 on: February 11, 2013, 06:31:03 am »
I wanted to say good job just to realize that this is for GUPS... Please create a script for general use and for GUPS use. I'm disappointed..  :(
I'm beginning to feel like a Lag God, Lag God

Offline JaVeD

  • Street Thug
  • *
  • Posts: 46
  • Want scripts? Pm me now! Just for $
    • View Profile
    • Free Host -> Clicky
Re: Want to slap someone ? :D
« Reply #2 on: February 11, 2013, 08:12:35 am »
Simple man this work in all pawn scripts you have all includes ? put it in your script if it don't work then post errors here i will try to fix error :D
SA:MP Server: 5.231.49.21:7777
Website: www.nse-server.com

Offline Fuzzy168

  • VC:MP Veteran
  • *****
  • Posts: 729
  • Programming since 2011
    • View Profile
Re: Want to slap someone ? :D
« Reply #3 on: February 11, 2013, 08:50:59 am »
IsLoggedIn and IsAuthorized are clearly from GUPS. Do you want me to slap you or can you see it already?
I'm beginning to feel like a Lag God, Lag God

Offline JaVeD

  • Street Thug
  • *
  • Posts: 46
  • Want scripts? Pm me now! Just for $
    • View Profile
    • Free Host -> Clicky
Re: Want to slap someone ? :D
« Reply #4 on: February 11, 2013, 10:45:25 am »
Simple you have to add in your script that to run this command
[pawn]stock IsAuthorized( playerid, cmd[] )
{
   return ( PlayerInfo[ playerid ][ Level ] >= dini_Int("/Configuration/Commands.ini << ( your location where u write commands for each level ) ", cmd ) ) ? true : false;
}[/pawn]

[pawn]stock IsLoggedIn( id )
{
   return ( PlayerInfo[ id ][ Logged ] == 1 ) ? true : false;
}[/pawn]
SA:MP Server: 5.231.49.21:7777
Website: www.nse-server.com

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: Want to slap someone ? :D
« Reply #5 on: February 11, 2013, 04:22:44 pm »
ENG: You can't use this command in all pawn scripts ! (Fuzzy already told you this)

You have to remove some variables to can be used for all scripts; variables like these:

Code: [Select]
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, GREEN, "Please log-in to your account." );
else if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, BLUE, "You don&#039;t have access to use this command!" );

GUPS have a lot of functions, and if you will make a cmd in GUPS, you will have to remove these variables to work for all scripts.

Good Luck !

PS: Do not write Romanian Lang. on this forum without adding and the translated version of your text, we speak here English.



RO: Nu poti folosi comanda asta la toate scripturile ! (Fuzzy ti-a spus deja asta)

Trebuie sa stergi (din comanda) variabilele care exista doar in GUPS si sa lasi comanda intr-o forma bazica.

"IsLoggedIn" , "IsAuthorized" sunt functii facute doar pentru GUPS, si implica un sistem de inregistrare, deci va trebui sa le stergi din scriptul lansat si va merge pentru toti.

Succes in continuare !

PS: Nu posta in limba romana pe acest forum fara a adauga si traducerea in engleza, vorbim limba pe care o inteleg toti ;)

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.