Raised This Month: $ Target: $400
 0% 

Solved [HELP] Cso weapon on ZP Primary


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
elmedin
Senior Member
Join Date: Nov 2013
Location: Bruh
Old 02-14-2019 , 18:41   Re: [HELP] Cso weapon on ZP Primary
Reply With Quote #1

Quote:
Originally Posted by PartialCloning View Post
Read up on natives. For now, you can add the following to get the basics to work.

In your weapon code:
PHP Code:
public plugin_natives()
{
    
register_native("wpn_GetBase""Callback_GetBase");
}

public 
Callback_GetBase(PluginIDParamNum)
{
    
Get_Base(get_param(1));

In your main code:
PHP Code:
native wpn_GetBase(id); 
Then use wpn_GetBase(id) instead of GetBase(id);

Thanks <3 it works
elmedin is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 02-14-2019 , 18:26   Re: [HELP] Cso weapon on ZP Primary
Reply With Quote #2

Code:
public plugin_natives() {     register_native("Get_Base", "Get_Base") }

Natives won't work magically just by typing "native whatever()".
Attached Files
File Type: sma Get Plugin or Get Source (whatever.sma - 108 views - 26.0 KB)
__________________









Last edited by CrazY.; 02-14-2019 at 18:29.
CrazY. is offline
elmedin
Senior Member
Join Date: Nov 2013
Location: Bruh
Old 02-14-2019 , 18:44   Re: [HELP] Cso weapon on ZP Primary
Reply With Quote #3

Quote:
Originally Posted by CrazY. View Post
Code:
public plugin_natives() {     register_native("Get_Base", "Get_Base") }

Natives won't work magically just by typing "native whatever()".
Tried yours too, seems easier to do but your method doesnt work
elmedin is offline
elmedin
Senior Member
Join Date: Nov 2013
Location: Bruh
Old 02-14-2019 , 18:50   Re: [HELP] Cso weapon on ZP Primary
Reply With Quote #4

Also 1 more thing, i know i sound greedy af but xd... when i choose weapon it shows first M4A1 model, but i have to switch to pistol or knife then to the Main weapon again to see the real model.. so i want when i choose the gun to be shown the model it should be .
elmedin is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 02-14-2019 , 19:04   Re: [HELP] Cso weapon on ZP Primary
Reply With Quote #5

Move
PHP Code:
if(weaponid == CSW_M4A1)
{
    
wpn_GetBase(id);  

above
PHP Code:
    // Give the new weapon and full ammo
    
fm_give_item(idwname)
    
ExecuteHamB(Ham_GiveAmmoidMAXBPAMMO[weaponid], AMMOTYPE[weaponid], MAXBPAMMO[weaponid]) 
PartialCloning is offline
elmedin
Senior Member
Join Date: Nov 2013
Location: Bruh
Old 02-15-2019 , 07:57   Re: [HELP] Cso weapon on ZP Primary
Reply With Quote #6

Thank you!!!
elmedin is offline
elmedin
Senior Member
Join Date: Nov 2013
Location: Bruh
Old 02-15-2019 , 08:07   Re: [HELP] Cso weapon on ZP Primary
Reply With Quote #7

1 more thing tho, if i want to add another weapon that is Equal to m4a1, but it will not work because Dark Knight took its place... so is there any solution to do 2 weapons in M4a1 ? to categorize them ? xd
elmedin is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 02-15-2019 , 08:13   Re: [HELP] Cso weapon on ZP Primary
Reply With Quote #8

If you'll give both weapons at same time, one of them will be removed/replaced. If you want to make that to work, you will need to recode one of the weapons and override another default weapon than m4a1 (ak47, e.g.).
__________________









Last edited by CrazY.; 02-15-2019 at 08:14.
CrazY. is offline
elmedin
Senior Member
Join Date: Nov 2013
Location: Bruh
Old 02-15-2019 , 08:14   Re: [HELP] Cso weapon on ZP Primary
Reply With Quote #9

Yeah i know that, its not hard but.. its no chance to make 2 weapons in m4a1's like adding If ?

Last edited by elmedin; 02-15-2019 at 08:16.
elmedin is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 02-15-2019 , 08:16   Re: [HELP] Cso weapon on ZP Primary
Reply With Quote #10

No, you can't duplicate weapons if that's what you mean, unless you code both weapons in same plugin and switch with right click of the mouse (as famas, glock18 or even m4a1 switch "fire mode").

You can code as many weapons as you want overriding m4a1. If the plugin is well coded the weapon won't cause glitches such as replace another custom weapons, but you can't have two m4a1 in inventory at same time.
__________________









Last edited by CrazY.; 02-15-2019 at 08:27.
CrazY. is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 00:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode