AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   colored hud messages and pressing button will respawn (https://forums.alliedmods.net/showthread.php?t=162015)

razieljohn619 07-13-2011 23:23

colored hud messages and pressing button will respawn
 
hey guys i'm working on this plugin that when u die a hud message (and the hud message will have different colors, like this /wPress /yX /wto respawn..)

and if u will press X u will respawn( i think pressing X to respawn instantly works already but i'm not sure) ..can u guys also help if the respawning player after 5 sec. after death is wrong..

the wrong i know here is the hud message..can someone help me??

when i drag the .sma to the compiler is all errors are pointing at the part of the hud message..so can someone help me?please..

PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <cstrike>


public plugin_init(){
    
register_plugin("Respawn""1.0""razieljohn619")
    
register_event("DeathMsg""death""a")
    
register_event("Spectator""event_spectator""a"
    
register_clcmd("respawn""respawns")
}


public 
death(){
    static 
id
    id 
read_data(2)
    if(
id<|| id>32)
        return
    if(!
is_user_connected(id) || is_user_alive(id))
        return
    
set_task(5.0"respawns"id)
}


public 
respawns(id){
    if(!
is_user_connected(id) || is_user_alive(id))
        return
    
dllfunc(DLLFunc_Spawnid)
}

public 
event_spectator() 

    
set_hudmessage(230 230 230, -1.00.8506.05.00.10.2, -1)
    
show_hudmessage("/wPress /yX /wto respawn "


//the "Press" message should be white,, "X" should be color yellow,, and "to respawn" is should be white..

NOTE: my server has respawn after 5 seconds after death, so if player can't wait., he'll just have to press X to respawn instantly..

Kreation 07-13-2011 23:36

Re: colored hud messages and pressing button will respawn
 
The only way to achieve your 'x' key respawn is by slow-hacking.

razieljohn619 07-14-2011 08:00

Re: colored hud messages and pressing button will respawn
 
it's up to the player of what he binds for respawn key..and that's just an example..

EDIT: i want the hud message to be shown on spectator..and someone please help me..


All times are GMT -4. The time now is 00:47.

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