Raised This Month: $ Target: $400
 0% 

deagle giver help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
adam3232
Member
Join Date: Oct 2006
Location: Canada
Old 01-01-2007 , 22:56   deagle giver help
Reply With Quote #1

i am in the process of trying to make a plugin that gives every one deagles when they join and its not working can some one tell me what i have done rong?
Code:
#include <amxmodx>
#include <fun>
#include <engine>
 
// 
 
public plugin_init()
{
 register_plugin("Dealge Giver","1.0","adam3232")
}
public client_putinserver(id)
{
 give_item(0,"14")
}
__________________
O_o | Adam |LDR| $ 7 / month for admin contact me at : [email protected]
[IMG]http://img244.**************/img244/8265/adam3232nd3.gif[/IMG]
adam3232 is offline
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 01-01-2007 , 23:07   Re: deagle giver help
Reply With Quote #2

client_putinserver(id)
is called when a player is connected in the server
You want an event which is called on spawn i believe.
Try this (untested)
PHP Code:
#include <amxmodx>
#include <fun>
#include <engine>
 
public plugin_init()
{
    
register_event("ResetHUD""event_hud_reset""be")
    
register_clcmd("fullupdate""clcmd_fullupdate"
    
register_event("TextMsg""event_restart_attempt""a""2=#Game_will_restart_in")
}

public 
clcmd_fullupdate() {
    return 
PLUGIN_HANDLED
}

public 
event_restart_attempt() {
    new 
players[32], num
    get_players
(playersnum"a")
    for (new 
inum; ++i)
        
g_restart_attempt[players[i]] = true
}

public 
event_hud_reset(id) {
    if (
g_restart_attempt[id]) {
        
g_restart_attempt[id] = false
        
return
    }

    
event_player_spawn(id)
}

// this function is called on player spawn
public event_player_spawn(id) {
    
give_item(0,"weapon_deagle")

Read this if you still having problems
http://forums.alliedmods.net/showthread.php?t=42159
__________________
It's a mystery.
Mini_Midget is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 01-02-2007 , 00:30   Re: deagle giver help
Reply With Quote #3

Quote:
Originally Posted by Mini_Midget View Post
client_putinserver(id)
is called when a player is connected in the server
You want an event which is called on spawn i believe.
Try this (untested)
PHP Code:
#include <amxmodx>
#include <fun>
#include <engine>
 
public plugin_init()
{
    
register_event("ResetHUD""event_hud_reset""be")
    
register_clcmd("fullupdate""clcmd_fullupdate"
    
register_event("TextMsg""event_restart_attempt""a""2=#Game_will_restart_in")
}

public 
clcmd_fullupdate() {
    return 
PLUGIN_HANDLED
}

public 
event_restart_attempt() {
    new 
players[32], num
    get_players
(playersnum"a")
    for (new 
inum; ++i)
        
g_restart_attempt[players[i]] = true
}

public 
event_hud_reset(id) {
    if (
g_restart_attempt[id]) {
        
g_restart_attempt[id] = false
        
return
    }

    
event_player_spawn(id)
}

// this function is called on player spawn
public event_player_spawn(id) {
    
give_item(0,"weapon_deagle")

Read this if you still having problems
http://forums.alliedmods.net/showthread.php?t=42159

give_item is in the fun module by the way.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
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 22:27.


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