Author Topic: !wep command  (Read 170 times)

kitt85711

  • Newbie
  • *
  • Posts: 1
    • View Profile
!wep command
« on: September 25, 2011, 05:23:29 am »
To make it so all you have to say is !wep (weapon) but no (Ammount) this is how...


Open your scripts and find the cmd !wep it should look like this in gups.

Quote
}
   else if ( strcmp( cmd, "!wep", true ) == 0 )
   {
       new tmp2[ 128 ], wep;
      tmp = strtok( cmdtext, idx ), tmp2 = strtok( cmdtext, idx );
      if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
      else if ( !strlen( tmp2 ) ) SendClientMessage( playerid, COLOR_GREEN, "USAGE: !wep [WeaponName/ID] [Ammo]" );
      else
      {
         wep = FindWepIDFromString( tmp );
         SetPlayerWeapon( playerid, wep, strval( tmp2 ) );
      }
      return 1;

Select all of that and delete it. Replace it with this

Quote
}
   else if (strcmp(cmd, "!wep", true) == 0) {
       new tmp2[256], wep;
      tmp = strtok(cmdtext, idx);
      if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
      else if (!strlen(tmp)) SendClientMessage(playerid, COLOR_GREEN, "USAGE: !wep [WeaponName/ID]");
      else {
         wep = FindWepIDFromString(tmp);
         SetPlayerWeapon(playerid,wep,9999);
      }
      return 1;

After that on the top you will see something that says Build.

Click that and click on compile. If you dont it wont take effect.

Restart your server.

Share on Bluesky Share on Facebook