AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Grenade spawn. (https://forums.alliedmods.net/showthread.php?t=220818)

ScrappeR 07-14-2013 18:53

Grenade spawn.
 
How to make every 10 seconds have grenade..?

PHP Code:

#include <amxmodx>
#include <hamsandwich>
#include <fun>


public plugin_init()
    
RegisterHam(Ham_Spawn"player""FwdPlayerSpawnPost"1);


public 
FwdPlayerSpawnPost(id)
{
    if(
is_user_alive(id))
        
give_item(id"weapon_smokegrenade");



akcaliberg 07-14-2013 19:06

Re: Grenade spawn.
 
PHP Code:

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn,"player","HamPlayerSpawnPost",1)    
}
public 
HamPlayerSpawnPost(id) {
    
give_item(id,"weapon_smokegrenade")
    
set_task(10.0,"GiveBomb",id,_,_,"b")
}
public 
GiveBomb(id) {
    if(!
is_user_connected(id) || !is_user_alive(id)) remove_task(id)
    else 
give_item(id,"weapon_smokegrenade")



ScrappeR 07-14-2013 19:20

Re: Grenade spawn.
 
Quote:

Originally Posted by akcaliberg (Post 1990969)
PHP Code:

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn,"player","HamPlayerSpawnPost",1)    
}
public 
HamPlayerSpawnPost(id) {
    
give_item(id,"weapon_smokegrenade")
    
set_task(10.0,"GiveBomb",id,_,_,"b")
}
public 
GiveBomb(id) {
    if(!
is_user_connected(id) || !is_user_alive(id)) remove_task(id)
    else 
give_item(id,"weapon_smokegrenade")



have same erros pls full script//

YamiKaitou 07-14-2013 19:22

Re: Grenade spawn.
 
Quote:

Originally Posted by ScrappeR (Post 1990972)
have same erros pls full script//

What errors? You never said you had errors before so how could you be having the same errors? To answer your original question, use a task

ScrappeR 07-14-2013 19:28

Re: Grenade spawn.
 
Quote:

Originally Posted by YamiKaitou (Post 1990973)
What errors? You never said you had errors before so how could you be having the same errors? To answer your original question, use a task

I need to mod the respawn?
When HEgrenade shoot after 10 seconds again to have HE?

ConnorMcLeod 07-14-2013 19:39

Re: Grenade spawn.
 
Lol, if you want HE grenade, why do you give SMOKE grenades ?

Also, you want 1 HE every 10 seconds, or 1 HE 10 seconds after player have thrown his last one ?

ScrappeR 07-14-2013 19:48

Re: Grenade spawn.
 
wtf?

Bro every 10 seconds and hudmessage
example, 10, 9, 8.... 1
You have HeGrenade!
Understand now?

mottzi 07-14-2013 21:00

Re: Grenade spawn.
 
yes, and this is no place to get free codes. Ask exact questions of scripting mechanics. Dont ask for c&p-ready code...

akcaliberg 07-14-2013 21:19

Re: Grenade spawn.
 
Are you requesting a plugin or want to learn how to do it ?

TheDS1337 07-15-2013 06:12

Re: Grenade spawn.
 
Tested and working:
Code:
#include <amxmodx> #include <fun> #include <hamsandwich> public plugin_init()     RegisterHam(Ham_Spawn, "player", "forward_SpawnPost", 1); public forward_SpawnPost(id) {     if (!is_user_alive(id))         return;             set_task(10.0, "task_GiveGrenade", id, _, _, "b"); } public task_GiveGrenade(id) {     if (user_has_weapon(id, CSW_HEGRENADE))         return;             give_item(id, "weapon_hegrenade"); }


All times are GMT -4. The time now is 06:22.

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