SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 13/09/2017, 08:24 PM   #4661
Bren
Big Clucker
 
Bren's Avatar
 
Join Date: Jul 2014
Location: Russia Orenburg
Posts: 66
Reputation: 0
Default Re: Useful Functions

Quote:
Originally Posted by Lokii View Post
Get weapon slot

Code:
stock GetWeaponSlot(weaponid)
{
    switch(weaponid)
    {
        case 0,1: return 0;
        case 2,3,4,5,6,7,8,9: return 1;
        case 10,11,12,13,14,15: return 10;
        case 16,17,18: return 8;
        case 22,23,24: return 2;
        case 25,26,27: return 3;
        case 28,29,32: return 4;
        case 30,31: return 5;
        case 33,34: return 6;
        case 35,36,37,38: return 7;
        case 39: return 8;
        case 40: return 12;
        case 41,42,43: return 9;
        case 44,45,46: return 11;
    }
    return -1;
}
example 1:

Code:
CMD:test(playerid, params[])
{
     new x[15];
     format(x, sizeof(x), "Minigun slot: %d",  GetWeaponSlot(38));
     printf(x);
     return 1;
}
example 2:

Code:
CMD:test2(playerid, params[])
{
     new x[23];
     format(x, sizeof(x), "Your weapon slot is: %d",  GetWeaponSlot(GetPlayerWeapon(playerid)));
     printf(x);
     return 1;
}
by: Nexius
PHP Code:
static const WSlot[] = {0011111111101010101010888, -1, -1, -122233344554667777812999111111};


CMD:test(playeridparams[]) return printf("Minigun slot: %d"WSlot[38]); 
Bren is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Functions? sciman001 Help Archive 7 19/03/2011 03:03 PM
How to get functions? Twain32 Help Archive 4 08/10/2010 07:37 PM
[Include] [INC] SA:MP New Functions 0.4a DKN ipsBruno Lançamentos/Releases 22 17/06/2010 08:38 AM
[Include] [INC] LSF - Lorenc's Simple Functions (w/ gang/clan functions) Lorenc_ Includes 11 03/05/2010 09:47 PM
What this functions do? harrold Help Archive 2 08/05/2009 11:30 PM


All times are GMT. The time now is 07:24 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.