Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- native GiveWeapon(playerid, weaponid, ammo);
- */
- #if defined _include_weapon_reload
- #endinput
- #endif
- #define _include_weapon_reload
- // INCLUDES --------------------------------------------------------------------
- #tryinclude <a_samp>
- // DEFINES ---------------------------------------------------------------------
- // macros
- #define FS_CALLBACK:%0(%1) forward %0(%1); public %0(%1)
- //------------------------------------------------------------------------------
- //others
- #define NAME_PROJECT "Weapon - Reload"
- #define CREATOR_PROJECT "Felipe_Alves"
- #define VERSION_PROJECT "0.1b"
- //------------------------------------------------------------------------------
- #define FUNCTION static
- #define FINITO 100000000000000000000
- // VARIAVEIS GLOBAL ------------------------------------------------------------
- //-- Txt:
- static
- Text:FundoPlayer[2],
- // VARIAVEIS PLAYER ------------------------------------------------------------
- //-- Txt:
- PlayerText:WeaponAndAmmo[MAX_PLAYERS][2],
- //--Int:
- disparos[MAX_PLAYERS][13],
- balas[MAX_PLAYERS][13],
- Timer[MAX_PLAYERS];
- // CALLBACKS NATIVAS DO SAMP --------------------------------------------------
- //------------------------------------------------------------------------------
- public OnGameModeInit()
- {
- // Global Textdraws:
- FundoPlayer[0] = TextDrawCreate(488.300018, 21.253330, "box");
- TextDrawLetterSize(FundoPlayer[0], 0.000000, 8.639999);
- TextDrawTextSize(FundoPlayer[0], 615.000000, 0.000000);
- TextDrawAlignment(FundoPlayer[0], 1);
- TextDrawColor(FundoPlayer[0], -1);
- TextDrawUseBox(FundoPlayer[0], 1);
- TextDrawBoxColor(FundoPlayer[0], -1464864257);
- TextDrawSetShadow(FundoPlayer[0], 0);
- TextDrawSetOutline(FundoPlayer[0], 0);
- TextDrawBackgroundColor(FundoPlayer[0], 255);
- TextDrawFont(FundoPlayer[0], 1);
- TextDrawSetProportional(FundoPlayer[0], 1);
- TextDrawSetShadow(FundoPlayer[0], 0);
- FundoPlayer[1] = TextDrawCreate(492.400024, 36.186668, "box");
- TextDrawLetterSize(FundoPlayer[1], 0.000000, 5.199999);
- TextDrawTextSize(FundoPlayer[1], 539.000000, 0.000000);
- TextDrawAlignment(FundoPlayer[1], 1);
- TextDrawColor(FundoPlayer[1], -1);
- TextDrawUseBox(FundoPlayer[1], 1);
- TextDrawBoxColor(FundoPlayer[1], 538837247);
- TextDrawSetShadow(FundoPlayer[1], 0);
- TextDrawSetOutline(FundoPlayer[1], 0);
- TextDrawBackgroundColor(FundoPlayer[1], 255);
- TextDrawFont(FundoPlayer[1], 1);
- TextDrawSetProportional(FundoPlayer[1], 0);
- TextDrawSetShadow(FundoPlayer[1], 0);
- for(new playerid = 0; playerid < MAX_PLAYERS; ++playerid) DestroyTxd(playerid);
- for(new i = 0; i < MAX_PLAYERS; i++) CreateTxd(i);
- for(new i = 0; i < 30; ++i)print(" ");
- print("\n--------------------------------------");
- print(" Carregado");
- printf("\n Nome: %s", NAME_PROJECT);
- printf(" By: %s", CREATOR_PROJECT);
- printf(" Versão: %s\n", VERSION_PROJECT);
- print("--------------------------------------\n");
- #if defined hook_OnGameModeInit
- return hook_OnGameModeInit();
- #else
- return 1;
- #endif
- }
- #if defined _ALS_OnGameModeInit
- #undef OnGameModeInit
- #else
- #define _ALS_OnGameModeInit
- #endif
- #define OnGameModeInit hook_OnGameModeInit
- #if defined hook_OnGameModeInit
- forward hook_OnGameModeInit();
- #endif
- public OnGameModeExit()
- {
- for(new i = 0; i < 30; ++i) print(" ");
- print("\n|-----------------------------------|");
- printf("| %s |", NAME_PROJECT);
- print("| Encerrado |");
- print("|-----------------------------------|\n");
- for(new i = 0; i < 2; ++i) TextDrawDestroy(FundoPlayer[i]);
- for(new playerid = 0; playerid < MAX_PLAYERS; ++playerid) if(IsPlayerConnected(playerid) || !IsPlayerConnected(playerid)) DestroyTxd(playerid);
- #if defined hook_OnGameModeExit
- return hook_OnGameModeExit();
- #else
- return 1;
- #endif
- }
- #if defined _ALS_OnGameModeExit
- #undef OnGameModeExit
- #else
- #define _ALS_OnGameModeExit
- #endif
- #define OnGameModeExit hook_OnGameModeExit
- #if defined hook_OnGameModeExit
- forward hook_OnGameModeExit();
- #endif
- public OnPlayerConnect(playerid){
- Timer[playerid] = SetTimerEx("UpdateWeapon", 50, 1, "d", playerid);
- #if defined hook_OnPlayerConnect
- return hook_OnPlayerConnect(playerid);
- #else
- return 1;
- #endif
- }
- #if defined _ALS_OnPlayerConnect
- #undef OnPlayerConnect
- #else
- #define _ALS_OnPlayerConnect
- #endif
- #define OnPlayerConnect hook_OnPlayerConnect
- #if defined hook_OnPlayerConnect
- forward hook_OnPlayerConnect(playerid);
- #endif
- public OnPlayerDisconnect(playerid, reason){
- KillTimer(Timer[playerid]);
- #if defined hook_OnPlayerDisconnect
- return hook_OnPlayerDisconnect(playerid, reason);
- #else
- return 1;
- #endif
- }
- #if defined _ALS_OnPlayerDisconnect
- #undef OnPlayerDisconnect
- #else
- #define _ALS_OnPlayerDisconnect
- #endif
- #define OnPlayerDisconnect hook_OnPlayerDisconnect
- #if defined hook_OnPlayerDisconnect
- forward hook_OnPlayerDisconnect(playerid, reason);
- #endif
- public OnPlayerSpawn(playerid){
- EncerrarTxd(playerid);
- SetTimerEx("CarregarTxd", 500, 0, "d", playerid);
- #if defined hook_OnPlayerSpawn
- return hook_OnPlayerSpawn(playerid);
- #else
- return 1;
- #endif
- }
- #if defined _ALS_OnPlayerSpawn
- #undef OnPlayerSpawn
- #else
- #define _ALS_OnPlayerSpawn
- #endif
- #define OnPlayerSpawn hook_OnPlayerSpawn
- #if defined hook_OnPlayerSpawn
- forward hook_OnPlayerSpawn(playerid);
- #endif
- public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ){
- // Conta os disparos;
- ++disparos[playerid][SlotsWeapons(weaponid)];
- // SetTimerEx é usado para verificar logo após o último disparo;
- SetTimerEx("WeaponCheck", 500, 0, "ddd", playerid, weaponid, 0); // 0 - ZERA O DISPARO QUANDO A VARIAVEL BALA == 0 && BALAS NA ARMA == 0;
- SetTimerEx("WeaponCheck", 500, 0, "ddd", playerid, weaponid, 1); // 1 - ZERA O DISPARO QUANDO BALAS NA ARMA == 0;
- if(disparos[playerid][SlotsWeapons(weaponid)] == 2 && weaponid == 26){
- ReturnAnimationReload(playerid, 26);
- }
- #if defined hook_OnPlayerWeaponShot
- return hook_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
- #else
- return 1;
- #endif
- }
- #if defined _ALS_OnPlayerWeaponShot
- #undef OnPlayerWeaponShot
- #else
- #define _ALS_OnPlayerWeaponShot
- #endif
- #define OnPlayerWeaponShot hook_OnPlayerWeaponShot
- #if defined hook_OnPlayerWeaponShot
- forward hook_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
- #endif
- public OnPlayerUpdate(playerid){
- new weaponid = GetPlayerWeapon(playerid), disparo = disparos[playerid][SlotsWeapons(weaponid)];
- if(weaponid != 0 && (weaponid != 16 || weaponid != 17 || weaponid != 18 || weaponid != 39 || weaponid != 40 ||
- weaponid != 41 || weaponid != 42 || weaponid != 43 || weaponid != 44 || weaponid != 45 || weaponid != 46)){
- if(weaponid > 0 && weaponid < 16)
- if(balas[playerid][SlotsWeapons(weaponid)] > 0){
- balas[playerid][SlotsWeapons(weaponid)] = 0;
- }
- if(disparo > ReturnWeaponLimitAmmo(weaponid)) disparos[playerid][SlotsWeapons(weaponid)] = ReturnWeaponLimitAmmo(weaponid);
- if(disparo == ReturnWeaponLimitAmmo(weaponid)){
- if(balas[playerid][SlotsWeapons(weaponid)] > 0)
- ReturnAnimationReload(playerid, weaponid);
- if(balas[playerid][SlotsWeapons(weaponid)] > 0 && balas[playerid][SlotsWeapons(weaponid)] < ReturnWeaponLimitAmmo(weaponid)){
- SetTimerEx("GivePlayerWeaponTimer", 50, 0, "ddd", playerid, weaponid, balas[playerid][SlotsWeapons(weaponid)]);
- balas[playerid][SlotsWeapons(weaponid)] = 0;
- }
- if(balas[playerid][SlotsWeapons(weaponid)] > ReturnWeaponLimitAmmo(weaponid)){
- SetTimerEx("GivePlayerWeaponTimer", 50, 0, "ddd", playerid, weaponid, ReturnWeaponLimitAmmo(weaponid));
- balas[playerid][SlotsWeapons(weaponid)] -= ReturnWeaponLimitAmmo(weaponid);
- }
- if(balas[playerid][SlotsWeapons(weaponid)] == ReturnWeaponLimitAmmo(weaponid)){
- SetTimerEx("GivePlayerWeaponTimer", 50, 0, "ddd", playerid, weaponid, ReturnWeaponLimitAmmo(weaponid));
- balas[playerid][SlotsWeapons(weaponid)] -= ReturnWeaponLimitAmmo(weaponid);
- }
- disparos[playerid][SlotsWeapons(weaponid)] = 0;
- return 1;
- }
- if(disparo > 0 && disparo < ReturnWeaponLimitAmmo(weaponid) && CheckWeaponAmmo(playerid, SlotsWeapons(weaponid))){
- if(balas[playerid][SlotsWeapons(weaponid)] > 0)
- ReturnAnimationReload(playerid, weaponid);
- if(balas[playerid][SlotsWeapons(weaponid)] > ReturnWeaponLimitAmmo(weaponid)){
- SetTimerEx("GivePlayerWeaponTimer", 50, 0, "ddd", playerid, weaponid, ReturnWeaponLimitAmmo(weaponid));
- balas[playerid][SlotsWeapons(weaponid)] -= ReturnWeaponLimitAmmo(weaponid);
- }
- if(balas[playerid][SlotsWeapons(weaponid)] > 0 && balas[playerid][SlotsWeapons(weaponid)] < ReturnWeaponLimitAmmo(weaponid)){
- SetTimerEx("GivePlayerWeaponTimer", 50, 0, "ddd", playerid, weaponid, balas[playerid][SlotsWeapons(weaponid)]);
- balas[playerid][SlotsWeapons(weaponid)] = 0;
- }
- if(balas[playerid][SlotsWeapons(weaponid)] == ReturnWeaponLimitAmmo(weaponid)){
- balas[playerid][SlotsWeapons(weaponid)] -= ReturnWeaponLimitAmmo(weaponid);
- SetTimerEx("GivePlayerWeaponTimer", 50, 0, "ddd", playerid, weaponid, balas[playerid][SlotsWeapons(weaponid)]);
- }
- disparos[playerid][SlotsWeapons(weaponid)] = 0;
- return 1;
- }
- ReajustWeaponAmmo(playerid);
- }
- #if defined hook_OnPlayerUpdate
- return hook_OnPlayerUpdate(playerid);
- #else
- return 1;
- #endif
- }
- #if defined _ALS_OnPlayerUpdate
- #undef OnPlayerUpdate
- #else
- #define _ALS_OnPlayerUpdate
- #endif
- #define OnPlayerUpdate hook_OnPlayerUpdate
- #if defined hook_OnPlayerUpdate
- forward hook_OnPlayerUpdate(playerid);
- #endif
- //--------------------------------------------------------------------------------
- // CALLBACKS ---------------------------------------------------------------------
- FS_CALLBACK:WeaponCheck(playerid, weaponid, verification){
- if(verification == 0)
- if(balas[playerid][SlotsWeapons(weaponid)] < 1 && CheckWeaponAmmo(playerid, SlotsWeapons(weaponid))){
- disparos[playerid][SlotsWeapons(weaponid)] = 0;
- }
- if(verification == 1){
- if(CheckWeaponAmmo(playerid, SlotsWeapons(weaponid))){
- disparos[playerid][SlotsWeapons(weaponid)] = 0;
- }
- }
- return 1;
- }
- FS_CALLBACK:UpdateWeapon(playerid){
- new string[28], weaponid = GetPlayerWeapon(playerid);
- PlayerTextDrawSetPreviewModel(playerid, WeaponAndAmmo[playerid][0], ReturnModelWeapon(GetPlayerWeapon(playerid)));
- PlayerTextDrawShow(playerid, WeaponAndAmmo[playerid][0]);
- if(weaponid > 0 && weaponid < 19 || weaponid == 32 || weaponid == 28 || (weaponid >= 35 && weaponid <= 37 ) || (weaponid >= 39 && weaponid <= 46))
- format(string, sizeof(string), "%d", GetPlayerAmmo(playerid));
- else if(weaponid != 0)
- format(string, sizeof(string), "%d-%d", balas[playerid][SlotsWeapons(GetPlayerWeapon(playerid))], GetPlayerAmmo(playerid));
- PlayerTextDrawSetString(playerid, WeaponAndAmmo[playerid][1], string);
- return 1;
- }
- FS_CALLBACK:EncerrarTxd(playerid){
- DestroyTxd(playerid);
- for(new i = 0; i < 2; ++i) TextDrawHideForPlayer(playerid, FundoPlayer[i]);
- for(new i = 0; i < 2; ++i) PlayerTextDrawHide(playerid, WeaponAndAmmo[playerid][i]);
- return 1;
- }
- FS_CALLBACK:CarregarTxd(playerid){
- CreateTxd(playerid);
- for(new i = 0; i < 2; ++i) TextDrawShowForPlayer(playerid, FundoPlayer[i]);
- for(new i = 0; i < 2; ++i) PlayerTextDrawShow(playerid, WeaponAndAmmo[playerid][i]);
- return 1;
- }
- FS_CALLBACK:DestroyTxd(playerid){
- for(new i = 0; i < 2; ++i) PlayerTextDrawDestroy(playerid, WeaponAndAmmo[playerid][i]);
- return 1;
- }
- FS_CALLBACK:CreateTxd(playerid){
- WeaponAndAmmo[playerid][0] = CreatePlayerTextDraw(playerid, 481.799926, 0.766670, "");
- PlayerTextDrawLetterSize(playerid, WeaponAndAmmo[playerid][0], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, WeaponAndAmmo[playerid][0], 85.000000, 126.000000);
- PlayerTextDrawAlignment(playerid, WeaponAndAmmo[playerid][0], 1);
- PlayerTextDrawColor(playerid, WeaponAndAmmo[playerid][0], -1);
- PlayerTextDrawSetShadow(playerid, WeaponAndAmmo[playerid][0], 0);
- PlayerTextDrawSetOutline(playerid, WeaponAndAmmo[playerid][0], 0);
- PlayerTextDrawBackgroundColor(playerid, WeaponAndAmmo[playerid][0], -256);
- PlayerTextDrawFont(playerid, WeaponAndAmmo[playerid][0], 5);
- PlayerTextDrawSetProportional(playerid, WeaponAndAmmo[playerid][0], 0);
- PlayerTextDrawSetShadow(playerid, WeaponAndAmmo[playerid][0], 0);
- PlayerTextDrawSetPreviewModel(playerid, WeaponAndAmmo[playerid][0], 348);
- PlayerTextDrawSetPreviewRot(playerid, WeaponAndAmmo[playerid][0], 0.000000, -30.00000, 0.000000, 2.200000);
- WeaponAndAmmo[playerid][1] = CreatePlayerTextDraw(playerid, 516.400024, 73.022270, "0-0");
- PlayerTextDrawLetterSize(playerid, WeaponAndAmmo[playerid][1], 0.256799, 1.316267);
- PlayerTextDrawAlignment(playerid, WeaponAndAmmo[playerid][1], 2);
- PlayerTextDrawColor(playerid, WeaponAndAmmo[playerid][1], -98);
- PlayerTextDrawSetShadow(playerid, WeaponAndAmmo[playerid][1], 0);
- PlayerTextDrawSetOutline(playerid, WeaponAndAmmo[playerid][1], 1);
- PlayerTextDrawBackgroundColor(playerid, WeaponAndAmmo[playerid][1], 106);
- PlayerTextDrawFont(playerid, WeaponAndAmmo[playerid][1], 1);
- PlayerTextDrawSetProportional(playerid, WeaponAndAmmo[playerid][1], 1);
- PlayerTextDrawSetShadow(playerid, WeaponAndAmmo[playerid][1], 0);
- return 1;
- }
- // FUNÇÕES ---------------------------------------------------------------------
- stock GiveWeapon(playerid, weaponid, ammo){
- if(ReturnPlayerWeapon(playerid, weaponid)){
- balas[playerid][SlotsWeapons(weaponid)] = 0;
- RemoveWeaponPlayer(playerid, SlotsWeapons(weaponid));
- SetTimerEx("GivePlayerWeaponEx", 100, 0, "ddd", playerid, weaponid, ammo);
- }else{
- if(CheckWeapon(playerid, weaponid) && ReturnWeaponsNoReload(weaponid))
- GivePlayerWeapon(playerid, weaponid, ammo);
- else
- SetTimerEx("GivePlayerWeaponEx", 100, 0, "ddd", playerid, weaponid, ammo);
- }
- return 1;
- }
- FS_CALLBACK:GivePlayerWeaponEx(playerid, weaponid, ammo){
- if(weaponid >= 16 && weaponid <= 18){
- GivePlayerWeapon(playerid, weaponid, ammo);
- return 1;
- }
- if(ammo > ReturnWeaponLimitAmmo(weaponid)){
- if(!CheckWeaponAmmo(playerid, SlotsWeapons(weaponid))){
- balas[playerid][SlotsWeapons(weaponid)] += ammo;
- }else{
- balas[playerid][SlotsWeapons(weaponid)] = ammo-ReturnWeaponLimitAmmo(weaponid);
- GivePlayerWeapon(playerid, weaponid, ReturnWeaponLimitAmmo(weaponid));
- }
- return 1;
- }else if(ammo < ReturnWeaponLimitAmmo(weaponid)){
- if(!CheckWeaponAmmo(playerid, SlotsWeapons(weaponid))){
- balas[playerid][SlotsWeapons(weaponid)] += ammo;
- }else{
- GivePlayerWeapon(playerid, weaponid, ammo);
- }
- return 1;
- }else if(ammo == ReturnWeaponLimitAmmo(weaponid)){
- if(!CheckWeaponAmmo(playerid, SlotsWeapons(weaponid))){
- balas[playerid][SlotsWeapons(weaponid)] += ReturnWeaponLimitAmmo(weaponid);
- }else{
- GivePlayerWeapon(playerid, weaponid, ReturnWeaponLimitAmmo(weaponid));
- }
- return 1;
- }
- return 1;
- }
- FS_CALLBACK:GivePlayerWeaponTimer(playerid, weaponid, ammo){
- return GivePlayerWeapon(playerid, weaponid, ammo);
- }
- FUNCTION ReturnWeaponsNoReload(weaponid){
- switch(weaponid){
- case 16, 17, 18, 28, 32, 35, 36, 37, 39, 41, 42, 43: return true;
- default: return false;
- }
- return false;
- }
- FUNCTION ReajustWeaponAmmo(playerid){
- if(GetPlayerAmmo(playerid) > ReturnWeaponLimitAmmo(GetPlayerWeapon(playerid))){
- ReajustWeapon(playerid);
- return 1;
- }
- return 1;
- }
- FUNCTION CheckWeapon(playerid, weaponid){
- new weapon, ammo;
- GetPlayerWeaponData(playerid, SlotsWeapons(weaponid), weapon, ammo);
- if(weaponid == weapon)
- return true;
- return false;
- }
- FUNCTION CheckWeaponAmmo(playerid, slot){
- new weaponid, ammo;
- GetPlayerWeaponData(playerid, slot, weaponid, ammo);
- if(ammo == 0)
- return true;
- return false;
- }
- FUNCTION ReajustWeapon(playerid){
- new armas[13][2];
- for(new i = 0; i < 13; i++){
- GetPlayerWeaponData(playerid, i, armas[i][0], armas[i][1]);
- }
- ResetPlayerWeapons(playerid);
- for(new i = 0; i < 13; i++){
- if(armas[i][1] > ReturnWeaponLimitAmmo(armas[i][0])){
- if(armas[i][1] > ReturnWeaponLimitAmmo(armas[i][0])){
- balas[playerid][i] = (armas[i][1] - ReturnWeaponLimitAmmo(armas[i][0]));
- GivePlayerWeapon(playerid, armas[i][0], ReturnWeaponLimitAmmo(armas[i][0]));
- disparos[playerid][SlotsWeapons(armas[i][0])] = 0;
- return 1;
- }
- }else{
- SetTimerEx("GivePlayerWeaponTimer", 50, 0, "ddd", playerid, armas[i][0], armas[i][1]);
- return 1;
- }
- }
- return 1;
- }
- FUNCTION RemoveWeaponPlayer(playerid, slot){
- new weapons[13][2];
- for(new i = 0; i < 13; i++){
- new weapon, ammo;
- GetPlayerWeaponData(playerid, i, weapon, ammo);
- if(i != slot)
- GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
- }
- disparos[playerid][slot] = 0;
- ResetPlayerWeapons(playerid);
- for(new i = 0; i < 13; i++){
- GivePlayerWeapon(playerid, weapons[i][0], weapons[i][1]);
- }
- return 1;
- }
- FUNCTION ReturnPlayerWeapon(playerid, weaponid){
- new weapons[13][2];
- for(new i = 0; i < 13; i++){
- GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
- if(SlotsWeapons(weaponid) == i && weapons[i][0] != weaponid)
- return true;
- }
- return false;
- }
- FUNCTION ReturnModelWeapon(modelid)
- {
- new idweapon = 0;
- switch(modelid){
- // ID DAS ARMAS EM OBJETO
- case 1: idweapon = 331;
- case 2: idweapon = 333;
- case 3: idweapon = 334;
- case 4: idweapon = 335;
- case 5: idweapon = 336;
- case 6: idweapon = 337;
- case 7: idweapon = 338;
- case 8: idweapon = 339;
- case 9: idweapon = 341;
- case 10: idweapon = 321;
- case 14: idweapon = 325;
- case 15: idweapon = 326;
- case 16: idweapon = 342;
- case 17: idweapon = 343;
- case 18: idweapon = 344;
- case 22: idweapon = 346;
- case 23: idweapon = 347;
- case 24: idweapon = 348;
- case 25: idweapon = 349;
- case 26: idweapon = 350;
- case 27: idweapon = 351;
- case 28: idweapon = 352;
- case 29: idweapon = 353;
- case 30: idweapon = 355;
- case 31: idweapon = 356;
- case 32: idweapon = 372;
- case 33: idweapon = 357;
- case 34: idweapon = 358;
- case 35: idweapon = 359;
- case 36: idweapon = 360;
- case 37: idweapon = 361;
- case 38: idweapon = 362;
- case 39: idweapon = 363;
- case 40: idweapon = 364;
- case 41: idweapon = 365;
- case 42: idweapon = 366;
- case 43: idweapon = 367;
- case 44: idweapon = 368;
- case 45: idweapon = 369;
- case 46: idweapon = 371;
- default: idweapon = 9088;
- }
- return idweapon;
- }
- FUNCTION SlotsWeapons(armaid){
- new slot;
- switch(armaid){
- case 0..1: slot = 0; // FIST
- case 2..9: slot = 1; // ARMA BRANCA
- case 10..15: slot = 10; // ARMAS SLAOQ
- case 16..18, 39: slot = 8; // EXPLOSIVOS
- case 22..24: slot = 2; // PISTOLAS
- case 25..27: slot = 3; // DOZES
- case 28..29, 32: slot = 4; // SUBS
- case 30..31: slot = 5; // FUZIS
- case 33..34: slot = 6; // SNIPERS
- case 35..38: slot = 7; // BAZUCAS
- case 40: slot = 12; // DETONADOR
- case 41..43: slot = 9; // SLAS
- case 44..46: slot = 11; // VISÃO
- }
- return slot;
- }
- FUNCTION ReturnAnimationReload(playerid, weaponid){
- switch(weaponid){
- case 22:
- ApplyAnimation(playerid, "COLT45", "COLT45_RELOAD", 4.1, false, false, 1, false, 0, false);
- case 23:
- ApplyAnimation(playerid, "SILENCED", "SILENCE_RELOAD", 4.1, false, false, 1, false, 0, false);
- case 24:
- ApplyAnimation(playerid, "PYTHON", "PYTHON_RELOAD", 4.1, false, false, 1, false, 0, false);
- case 25:
- ApplyAnimation(playerid, "SHOTGUN", "SHOTGUN_FIRE_POOR", 4.1, false, false, 1, false, 0, false);
- case 26:
- ApplyAnimation(playerid, "COLT45", "SAWNOFF_RELOAD", 4.1, false, false, 1, false, 0, false);
- case 27:
- ApplyAnimation(playerid, "BUDDY", "buddy_reload", 4.1, false, false, 1, false, 0, false);
- case 29, 30, 31, 33, 34, 38:
- ApplyAnimation(playerid, "RIFLE", "RIFLE_LOAD", 4.1, false, false, 1, false, 0, false);
- case 28:
- ApplyAnimation(playerid, "UZI", "UZI_RELOAD", 4.1, false, false, 1, false, 0, false);
- case 32:
- ApplyAnimation(playerid, "TEC", "TEC_RELOAD", 4.1, false, false, 1, false, 0, false);
- }
- }
- FUNCTION ReturnWeaponLimitAmmo(weaponid){
- new limit = 0;
- switch(weaponid){
- case 0..1, 25, 44..46: limit = 1;
- case 16..18, 28, 32, 35..37, 39, 40..43: limit = FINITO;
- case 22: limit = 34;
- case 23: limit = 17;
- case 24, 27: limit = 7;
- case 26: limit = 4;
- case 31: limit = 50;
- case 29, 30: limit = 30;
- case 33, 34: limit = 10;
- case 38: limit = 500;
- default: limit = 1;
- }
- return limit;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement