Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Snippet Showroom => Topic started by: JaVeD on February 11, 2013, 06:27:47 am

Title: Want to slap someone ? :D
Post by: JaVeD 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]
Title: Re: Want to slap someone ? :D
Post by: Fuzzy168 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..  :(
Title: Re: Want to slap someone ? :D
Post by: JaVeD 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
Title: Re: Want to slap someone ? :D
Post by: Fuzzy168 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?
Title: Re: Want to slap someone ? :D
Post by: JaVeD 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]
Title: Re: Want to slap someone ? :D
Post by: sseebbyy 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 ;)