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

!spawn


Post New Thread Reply   
 
Thread Tools Display Modes
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
Pantheon
Member
Join Date: Jan 2011
Old 01-07-2011 , 19:45   Re: !spawn
Reply With Quote #2

Replace
register_plugin(PLUGIN, VERSION, AUTHOR)
with
register_plugin("The Plugin Name", "The Actual Version", "The Author")
Pantheon is offline
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 01-07-2011 , 20:05   Re: !spawn
Reply With Quote #3

I fixed it, but now has another error

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("drspawm""1.0""Rodrigo286")
    
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()

[IMG]http://img703.**************/img703/1273/plugin2c.png[/IMG]
rodrigo286 is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 01-07-2011 , 20:14   Re: !spawn
Reply With Quote #4

Change VERSION to the same thing as you did before...?
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 01-08-2011 , 12:50   Re: !spawn
Reply With Quote #5

Can anyone help me or make me a simple plugin with a command !spawn to spawn, with a limit of two uses is to deathrun.
rodrigo286 is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 01-08-2011 , 13:03   Re: !spawn
Reply With Quote #6

Who limits ?
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 01-08-2011 , 13:12   Re: !spawn
Reply With Quote #7

2 usage limits, using the !spawn command the player revive but can only use this command for a maximum of two times.

Last edited by rodrigo286; 01-08-2011 at 13:15.
rodrigo286 is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 01-08-2011 , 13:16   Re: !spawn
Reply With Quote #8

Code:
#include <amxmodx> #include <amxmisc> #include <hamsandwich> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "author" new Limits[33] = 3 public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_clcmd("say /respawn", "respawn") } public respawn(id) {     if ( Limits[id] >= 0 && !is_user_alive(id))     {         ExecuteHamB(Ham_CS_RoundRespawn, id)         Limits[id]--         client_print(id, print_chat, "[AMXX] Remaining %d Respawns", Limits[id])     } }

check no tested.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 01-08-2011 , 13:25   Re: !spawn
Reply With Quote #9

Quote:
Originally Posted by lucas_7_94 View Post
Code:
#include <amxmodx> #include <amxmisc> #include <hamsandwich> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "author" new Limits[33] = 3 public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_clcmd("say /respawn", "respawn") } public respawn(id) {     if ( Limits[id] >= 0 && !is_user_alive(id))     {         ExecuteHamB(Ham_CS_RoundRespawn, id)         Limits[id]--         client_print(id, print_chat, "[AMXX] Remaining %d Respawns", Limits[id])     } }

check no tested.

Code:
#include <amxmodx> #include <amxmisc> #include <hamsandwich> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "author" new Limits[33] = 3 public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_clcmd("say /respawn", "respawn") } public respawn(id) {     if ( Limits[id] >= 0 && !is_user_alive(id))     {         ExecuteHamB(Ham_CS_RoundRespawn, id)         Limits[id]--         client_print(id, print_chat, "[AMXX] Remaining %d Respawns", Limits[id])     } } public client_putinserver( id ) Limits[id] = 3 public client_disconnect( id ) Limits[id] = 3
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 01-08-2011 , 13:32   Re: !spawn
Reply With Quote #10

i forgot that.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
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 06:17.


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