Raised This Month: $ Target: $400
 0% 

!spawn


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 01-07-2011 , 19:43   !spawn
Reply With Quote #1

I used the code of two plugins forum here to make a plugin to revive with a limit of uses, but when you get error compiles, what did I do wrong?

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

new g_spawn_modeg_spawn_max
new bool:g_canspawn[33], g_used[33]
new 
Float:g_spawns[33][3], Float:g_angles[33][3]

public 
plugin_init()
{    
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_cvar("dr_extra_sPawn",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)
    
    
g_ztele_mode register_cvar("dr_extra_spawn_mode""0"// 0 - both teams, 1 - humans, 2 - zombies
    
g_ztele_max register_cvar("dr_extra_spawn_max""3"// how many times you can use ztele
    
        
register_clcmd("say /spawn""CmdSpawn");
    
register_clcmd("say !spawn""CmdSpawn");
    
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn"1)
    
}

public 
client_connect(id)
{
    
g_used[id] = 0
    g_canztele
[id] = false
}

public 
client_disconnect(id)
{
    
g_used[id] = 0
    g_canztele
[id] = false
}

public 
fw_PlayerSpawn(id)
{
    if (!
is_user_alive(id))
        return 
HAM_IGNORED
    
    g_canztele
[id] = false
    
    pev
(idpev_origing_spawns[id])
    
pev(idpev_anglesg_angles[id])
    
    
client_print(idprint_chat"[Deathrun] este server está rodando drspawn by Rodrigo286, use !spawn para renascer")
    
    return 
HAM_IGNORED
}

public 
CmdSpawn(id)
{
    if (!
is_user_alive(id))
    {
        
g_used[id] = 0
        g_canspawn
[id] = false
        
        client_print
(idprint_chat"[Deathrun] voce precisa estar morto para usar !spawn")
        
        return 
PLUGIN_HANDLED
    
}
    
    switch (
get_pcvar_num(g_spawn_mode))
    {
        case 
1:
        {
            if (
zp_get_user_human(id))
            {
                
teleport_player(id)
            
client_print(idprint_chat"[Deathrun] Voce foi revido para seu spawn.")
            
client_print(idprint_chat"[Deathrun] Voce reviveu %d de %d vezes"get_pcvar_num(g_spawn_max))
            }
        }
    }
    
    if (
get_pcvar_num(g_spawn_max) == g_used[id])
    {
        
g_canspawn[id] = false
        client_print
(idprint_chat"[Deathrun] Voce nao pode reviver novamente voce usou %d de %d vezes"get_pcvar_num(g_spawn_max))
        
        return 
PLUGIN_HANDLED
    
}
    
    return 
PLUGIN_CONTINUE
}


public 
CmdSpawn(id)
    
    
ExecuteHamB(Ham_CS_RoundRespawnid); 
}

stock teleport_player(id)
{
    
g_used[id]++
    
    
set_pev(id,pev_origing_spawns[id])
    
set_pev(idpev_anglesg_angles[id])

    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(Ham_CS_RoundRespawn)
    
engfunc(EngFunc_WriteCoordg_spawns[id][0])
    
engfunc(EngFunc_WriteCoordg_spawns[id][1])
    
engfunc(EngFunc_WriteCoordg_spawns[id][2])
    
message_end()

error:

[IMG]http://img808.**************/img808/8361/plugin.png[/IMG]

Thanks!

Last edited by rodrigo286; 01-07-2011 at 20:00.
rodrigo286 is offline
 


Thread Tools
Display Modes

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 02:11.


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