Raised This Month: $51 Target: $400
 12% 

Shop Menu Tutorial For CS 1.6


Post New Thread Reply   
 
Thread Tools Display Modes
jeremyfreitas
Member
Join Date: Sep 2013
Old 10-08-2013 , 14:33   Re: Shop Menu Tutorial For CS 1.6
Reply With Quote #11

Hello friends, also I have this shop and liked to include some things and one of them is AK47 Golden, somebody can explain me as makes stops for the code?

AK: (https://forums.alliedmods.net/showthread.php?p=827532)
jeremyfreitas is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 10-09-2013 , 10:02   Re: Shop Menu Tutorial For CS 1.6
Reply With Quote #12

Edit shop menu and add item ak47. Then in menu handler, make in golden ak case:
PHP Code:
g_HasGoldenAk[id] = true
give_item
(id"weapon_ak47"
after that, add this to make ak47 has model and do more damage.

PHP Code:
new const g_ModelGoldenAk[] = "models/v_golden_ak47.mdl"
 
new bool:g_HasGoldenAk[MAX_PLAYERS+1]
new 
gak_damage
 
public plugin_init() 
{
    
RegisterHam(Ham_TakeDamage"player""ham_TakeDamage_Pre")
    
RegisterHam(Ham_Item_Deploy"weapon_ak47""ham_deploy_Ak47"1)
    
    
gak_damage register_cvar("golden_ak_damage""1.5")
}
 
public 
plugin_precache()
{
    
precache_model(g_ModelGoldenAk)
}

/* In shop add item and in shop handler turn the bool true and give ak47*/
 
public ham_TakeDamage_Pre(victiminflictorattackerFloat:damagedamage_bits)
{
    if(
g_HasGoldenAk[attacker] && is_user_alive(attacker) && inflictor == attacker && get_user_weapon(attacker) == CSW_AK47)
        
SetHamParamFloat(4damage get_pcvar_float(gak_damage))
}

public 
ham_deploy_Ak47(weapon_ent)
{
    static 
owner
    owner 
get_pdata_cbase(weapon_ent414)
    
    if(
is_user_alive(owner) && g_HasGoldenAk[owner])
        
set_pev(ownerpev_viewmodel2g_ModelGoldenAk)

Also you should reset the bool at spawn and client_connect.
__________________
Jhob94 is offline
morrow
Member
Join Date: Dec 2008
Old 10-16-2013 , 06:00   Re: Shop Menu Tutorial For CS 1.6
Reply With Quote #13

no golden AK please in servers
morrow is offline
Dawood Najam
Junior Member
Join Date: Mar 2014
Location: Lahore, Pakistan
Old 03-22-2014 , 07:59   Re: Shop Menu Tutorial For CS 1.6
Reply With Quote #14

Can anyone tell me where to add this code please tell me please?
Dawood Najam is offline
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 03-22-2014 , 09:28   Re: Shop Menu Tutorial For CS 1.6
Reply With Quote #15

it was for a specific request, a shop thingy. the OP seems to already know pawn scripting, so it's useless for other persons. read previous posts to understand.
__________________
ANTICHRISTUS is offline
Dawood Najam
Junior Member
Join Date: Mar 2014
Location: Lahore, Pakistan
Old 03-22-2014 , 22:46   Re: Shop Menu Tutorial For CS 1.6
Reply With Quote #16

Hi Jhob94 !
you are very funny. I saw your photo
Dawood Najam is offline
Dawood Najam
Junior Member
Join Date: Mar 2014
Location: Lahore, Pakistan
Old 03-22-2014 , 23:03   Re: Shop Menu Tutorial For CS 1.6
Reply With Quote #17

is it scripting?
I don't understand from the previous page.
I want to know that where to add this and what type of file to save it in?
Dawood Najam is offline
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 03-23-2014 , 03:33   Re: Shop Menu Tutorial For CS 1.6
Reply With Quote #18

put the code in a texte file and change the extension to .sma >> compile to get the .amxx file.
__________________

Last edited by ANTICHRISTUS; 03-23-2014 at 03:33.
ANTICHRISTUS is offline
Dawood Najam
Junior Member
Join Date: Mar 2014
Location: Lahore, Pakistan
Old 03-23-2014 , 08:20   Re: Shop Menu Tutorial For CS 1.6
Reply With Quote #19

I compiles it but i dont get a .amxx file? how to get that?
Dawood Najam is offline
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 03-23-2014 , 08:33   Re: Shop Menu Tutorial For CS 1.6
Reply With Quote #20

Quote:
Originally Posted by Dawood Najam View Post
I compiles it
no, you didn't.
Quote:
but i dont get a .amxx file? how to get that?
the web compiler. or [HOWTO] Compile locally with custom includes
__________________
ANTICHRISTUS 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 21:01.


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