Tutorial grenade_throw

Tutoriale scripting, cod si portiuni de cod.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
h4wk
Fost moderator
Fost moderator
Posts: 3806
Joined: 22 Sep 2009, 13:10
Detinator Steam: Da
Reputatie: Fost eXtream Mod
Nume anterior : DaZ , zimpe , Dan eXtream
Location: Iasi
Has thanked: 306 times
Been thanked: 321 times
Contact:

29 Nov 2013, 19:24

Tutorial creat de ExoTiQ

Code: Select all

forward grenade_throw( index,greindex,wId );
Aceasta functie verifica daca jucatorul a aruncat grenada. (Grenade Event)

Mai jos plugin , pentru exemplu.
Peste 15 secunde dupa ce ai aruncat HE , primeste inca un HE.

Code: Select all

#include <amxmodx>
#include <fun>
 
#define PLUGIN "test"
#define VERSION "1.0"
#define AUTHOR "ExoTiQ"
 
 
public plugin_init() {
        register_plugin(PLUGIN, VERSION, AUTHOR)
}
 
public grenade_throw ( index, greindex, wId )
{
        if(wId==4) set_task(15.0,"give_he" ,index, _, _, "a", 1)
        return PLUGIN_CONTINUE
}
 
public give_he( index) {
        give_item(index,"weapon_hegrenade")
        return PLUGIN_CONTINUE
}
wId - inseamna Weapon ID

Poftim info din amxmodx.inc

Code: Select all

/**
 * Returns the weapon id, otherwise 0 when no id found.
 * The weapon name is case sensitive, and has the weapon_* form.
 */
native get_weaponid(const name[]); 

Code: Select all

get_weaponid(const name[])
unde const name[]) - numele de la arma weapon_* (de exemplu weapon_awp )

Eu am folosit If( wId == 4 ) unde wId == 4 inseamna Weapon ID 4 (weapon_hegrenade).
Poftim lista cu weapons id - https://wiki.alliedmods.net/CS_Weapons_Information

Code: Select all

"Daca ai culoare nu inseamna ca esti mai presus ca un utilizator. Culoare e un fel de "rasplata" pentru ca te implici in "ridicarea" acestei comunitati.
Unii nu realizeaza ca daca ai culoare nu inseamna ca esti smecher." -- by Alexey
:troll :troll

Spui ceva,dar faci altceva !
RoyalServer 2
User avatar
ExoTiQ
Membru, skill +1
Membru, skill +1
Posts: 180
Joined: 21 Aug 2012, 21:44
Detinator Steam: Da
CS Status: Funny
Detinator server CS: Da
SteamID: Privat
Has thanked: 4 times
Been thanked: 52 times
Contact:

29 Nov 2013, 19:30

Cand am postat raspunsul aici >> http://www.extreamcs.com/forum/cereri-c ... 23607.html
Nici nu am stiut ca am facut un tutorial :D
Mersi.

Momentan,activitate mai slaba.
.


*[Anti Auto-Connect] [Config exec Connect IP Checker] [60%] [Public]
*[SISA Zombie + CSO Shop] [79%] [Contracost]

*[Plugin Snow] [100%] [La cerere - Privat]

* Screen#1 / Screen#2 / Screen#3
Acest plugin este facut la cerere si nu o sa fie public !
O sa fie public doar daca il face public Askhanar.



LordOfNothing
Membru, skill +1
Membru, skill +1
Posts: 387
Joined: 19 Jul 2013, 15:51
Detinator Steam: Nu
Reputatie: Restrictie PM
Has thanked: 11 times
Been thanked: 35 times

27 Mar 2014, 10:47

putem folosi eventul ca sa blocam aruncarea grenadei ?
Post Reply

Return to “Scripting”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests