AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Need Respawn dead player as Terrorist (https://forums.alliedmods.net/showthread.php?t=77277)

filo 09-09-2008 12:48

[HELP] Need Respawn dead player as Terrorist
 
I am too new scripthing (this is my first scripth) and i want to know what is wrong with my code

PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>


#define PLUGIN "Respawn as T"
#define VERSION "1.0"
#define AUTHOR "Filo"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say respawn""respawn")


}


public 
respawn(id)
{
    if(
is_user_connected(id))
    {
        if (
get_user_health"0"))
    
set_user_health "100" )
    
cs_set_user_team "1" )
        
}



EvolDay 09-09-2008 13:21

Re: [HELP] Need Respawn dead player as Terrorist
 
You are missing #include <fakemeta> and

cs_set_user_team ( "1" ) to cs_set_user_team (id,CS_TEAM_T)

and i dont think you need fun or amxmisc

filo 09-09-2008 13:25

Re: [HELP] Need Respawn dead player as Terrorist
 
Well I did it now the code is:
PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <fakemeta>

#define PLUGIN "Respawn as T"
#define VERSION "1.0"
#define AUTHOR "Filo"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say respawn""respawn")


}


public 
respawn(id)
{
    if(
is_user_connected(id))
    if (
get_user_health("0"))
    {        
    
set_user_health ("100")
    
cs_set_user_team (id,CS_TEAM_T
        
print_chat ("You has been Respawned as Terrorist")
}


But I have these errors:

Warning: Loose indentation on line 16
Error: Argument type mismatch (argument 1) on line 25
Error: Argument type mismatch (argument 1) on line 27
Error: Invalid function call, not a valid address on line 29
Warning: Expression has no effect on line 29
Error: Expected token: ";", but found ")" on line 29
Error: Invalid expression, assumed zero on line 29
Error: Too many error messages on one line on line 29

Compilation aborted.
6 Errors.

EvolDay 09-09-2008 13:32

Re: [HELP] Need Respawn dead player as Terrorist
 
take away the set_user_health ("100") and if (get_user_health("0"))

filo 09-09-2008 13:38

Re: [HELP] Need Respawn dead player as Terrorist
 
Finally Copiled go to test it


All times are GMT -4. The time now is 03:13.

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