Szerző Téma: Skin re fegyver  (Megtekintve 826 alkalommal)

Skin re fegyver
« Dátum: 2011. Augusztus 21. - 14:47:44 »
0 Show voters
Üdv!

Láttam sok szerveren ha a játékos éppen nem azt a fegyvert használja akkor a hátán van vagy az oldalán jelenik meg..


PL: Ak47, M4


Kersetem sokat de nem találtam 1 etse..


Kérnék 1 ilyen scriptet :DDD

Nem elérhető lusta19

  • 9084
  • £u$taÐi$znó
    • Profil megtekintése
Skin re fegyver
« Válasz #1 Dátum: 2011. Augusztus 21. - 16:17:49 »
+1 Show voters
#include <a_samp>
#define WEAPON_TYPE_NONE    (0)
#define WEAPON_TYPE_HEAVY   (1)
#define WEAPON_TYPE_LIGHT   (2)
#define WEAPON_TYPE_MELEE   (3)//Nahkampf
new OldWeapon[MAX_PLAYERS];
new HoldingWeapon[MAX_PLAYERS];
//------------------------------------------------------------------------------------------------------
public OnFilterScriptExit()
{
for(new i=0;i<MAX_PLAYERS;i++)
    if(IsPlayerConnected(i))
   StopPlayerHoldingObject(i);
return 1;
}
public OnPlayerConnect(playerid)
{
OldWeapon[playerid]=0;
HoldingWeapon[playerid]=0;
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate==PLAYER_STATE_ONFOOT)
{
StopPlayerHoldingObject(playerid);
OldWeapon[playerid]=0;
HoldingWeapon[playerid]=0;
}
return 1;
}
public OnPlayerUpdate(playerid)
{
if(GetPlayerState(playerid)==PLAYER_STATE_ONFOOT)
{
new weaponid=GetPlayerWeapon(playerid),oldweapontype=GetWeaponType(OldWeapon[playerid]);
new weapontype=GetWeaponType(weaponid);
if(HoldingWeapon[playerid]==weaponid)
    StopPlayerHoldingObject(playerid);
   
if(OldWeapon[playerid]!=weaponid)
{
    new modelid=GetWeaponModel(OldWeapon[playerid]);
    if(modelid!=0 && oldweapontype!=WEAPON_TYPE_NONE && oldweapontype!=weapontype)
    {
        HoldingWeapon[playerid]=OldWeapon[playerid];
        switch(oldweapontype)
        {
            case WEAPON_TYPE_LIGHT:
            SetPlayerHoldingObject(playerid, modelid, 8,0.0,-0.1,0.15, -100.0, 0.0, 0.0);
         case WEAPON_TYPE_MELEE:
             SetPlayerHoldingObject(playerid, modelid, 7,0.0,0.0,-0.18, 100.0, 45.0, 0.0);
         case WEAPON_TYPE_HEAVY:
             SetPlayerHoldingObject(playerid, modelid, 1, 0.2,-0.125,-0.1,0.0,25.0,180.0);
        }
    }
}
if(oldweapontype!=weapontype)
   OldWeapon[playerid]=weaponid;
}
return 1;
}
//------------------------------------------------------------------------------------------------------
GetWeaponType(weaponid)
{
switch(weaponid)
{
    case 22,23,24,26,28,32:
        return WEAPON_TYPE_LIGHT;
case 3,4,16,17,18,39,10,11,12,13,14,40,41:
    return WEAPON_TYPE_MELEE;
case 2,5,6,7,8,9,25,27,29,30,31,33,34,35,36,37,38:
    return WEAPON_TYPE_HEAVY;
}
return WEAPON_TYPE_NONE;
}
stock GetWeaponModel(weaponid)
{
switch(weaponid)
{
    case 1:
        return 331;
case 2..8:
    return weaponid+331;
        case 9:
    return 341;
case 10..15:
   return weaponid+311;
case 16..18:
    return weaponid+326;
case 22..29:
    return weaponid+324;
case 30,31:
    return weaponid+325;
case 32:
    return 372;
case 33..45:
    return weaponid+324;
case 46:
    return 371;
}
return 0;
}

Skin re fegyver
« Válasz #2 Dátum: 2011. Augusztus 22. - 12:54:20 »
0 Show voters
Köcce ment a + ! :DD

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal