AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   NATIVE ERROR!!!!!!!! (https://forums.alliedmods.net/showthread.php?t=54203)

Troi 04-19-2007 15:51

NATIVE ERROR!!!!!!!!
 
Hello, me again...
Ive got a NATIVE ERROR on set_user_health.. I wish bot have 999999hp

PHP Code:

/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"
 
public plugin_init() {
 
register_plugin(PLUGINVERSIONAUTHOR)
 
register_event("HLTV""RoundStart""a""1=0""2=0")
}
public 
RoundStart() {
 
client_print(0print_chat"YOU HAVE MUCH HP!")
 
set_user_health(0999999)
 
 return 
PLUGIN_CONTINUE;



The Angel Reality 04-19-2007 15:53

Re: NATIVE ERROR!!!!!!!!
 
Why do you return plugin? Give me a look at the rest of it. And are you sure you want 99999 HP? Pretty lazy though.

Deviance 04-19-2007 16:22

Re: NATIVE ERROR!!!!!!!!
 
Code:

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

#define PLUGIN "Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"
 
public plugin_init()
{
        register_plugin(PLUGIN, VERSION, AUTHOR)
        register_event("HLTV", "RoundStart", "a", "1=0", "2=0")
}
public RoundStart()
{
        new players[32], num
        get_players(players, num, "d")

        new player
        for(new i=0;i<num;i++)
        {
                player = players[i]

                client_print(player, print_chat, "YOU HAVE MUCH HP!")
                set_user_health(player, 999999)
        }
}


Nican 04-19-2007 16:23

Re: NATIVE ERROR!!!!!!!!
 
You might not want to set user health to 999999
You can crash the user from overloading

use
set_user_godmode(id, 1/0)
or a lower life

Troi 04-20-2007 02:09

Re: NATIVE ERROR!!!!!!!!
 
Thanks, you see I want to make that many hp I cant to kill a bot.... Well it is kind of training to me... he shoots at me, Im at him, a lot of blood...... etc.

The game is not crashing couse I made a client_cmd with 999999hp everythink is ok... But... Bot cannot write the command in console :)

By the way, god mode is a bit wrong for me, couse I dont see I hit him or not ... Its like the shooting to high ping player ..

Deviance, plugin is not working =[ but without errors ..

The Angel Reality 04-20-2007 02:32

Re: NATIVE ERROR!!!!!!!!
 
#include <amxmodx>
#include <amxmisc>
#include <fun>

#define PLUGIN "Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("HLTV", "RoundStart", "a", "1=0", "2=0")
}
public RoundStart()
{
new players[1], num
get_players(players, num, "d")

new player
for(new i=0;i<num;i++)
{
player = players[i]

client_print(player, print_chat, "YOU HAVE MUCH HP!")
set_user_health(player, 999999)
}

Troi 04-20-2007 02:35

Re: NATIVE ERROR!!!!!!!!
 
Error came while compiling

Quote:

Welcome to the AMX Mod X 1.76-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team
Error: Array sizes do not match, or destination array is too small on line 20
Error: Expected token: "}", but found "-end of file-" on line 29
2 Errors.
Could not locate output file D:\%path%\daughp.amx (compile failed).

The Angel Reality 04-20-2007 02:51

Re: NATIVE ERROR!!!!!!!!
 
your life intenger is too long to compile...

Troi 04-20-2007 04:58

Re: NATIVE ERROR!!!!!!!!
 
Hmmmm... But this plugin work good for me:

PHP Code:

/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "Training plugin"
#define VERSION "1.0"
#define AUTHOR "Gethix"
#define MKA "weapon_m4a1"
#define AK "weapon_ak47"
#define FAMAS "weapon_famas"
 
public plugin_init() {
 
register_plugin(PLUGINVERSIONAUTHOR)
 
register_clcmd("me_hp""hp"ADMIN_LEVEL_H)
 
register_clcmd("me_m4a1""m4a1"ADMIN_LEVEL_H)
 
register_clcmd("me_ak47""ak47"ADMIN_LEVEL_H)
 
register_clcmd("me_famas""famas"ADMIN_LEVEL_H)
 
register_clcmd("me_flash""flash"ADMIN_LEVEL_H)
 
register_clcmd("me_deagle""deagle"ADMIN_LEVEL_H)
 
register_clcmd("me_usp""usp"ADMIN_LEVEL_H)
 
register_clcmd("me_glock""glock"ADMIN_LEVEL_H)
}
public 
hp(id) {
 
set_user_health(id999999)
 
client_print(idprint_chat"YOU HAVE MUCH HP!")
}
public 
flash(id) {
 
give_item(id"weapon_flashbang")
 
give_item(id"weapon_flashbang")
}
public 
m4a1(id) {
 
give_item(idMKA)
 
give_item(idMKA)
 
give_item(idMKA)
 
give_item(idMKA)
}
public 
ak47(id) {
 
give_item(idAK)
 
give_item(idAK)
 
give_item(idAK)
 
give_item(idAK)
}
public 
famas(id) {
 
give_item(idFAMAS)
 
give_item(idFAMAS)
 
give_item(idFAMAS)
 
give_item(idFAMAS)
}
public 
deagle(id) {
 
give_item(id"weapon_deagle")
 
give_item(id"weapon_deagle")
 
give_item(id"weapon_deagle")
 
give_item(id"weapon_deagle")
 
give_item(id"weapon_deagle")
}
public 
usp(id) {
 
give_item(id"weapon_usp")
 
give_item(id"weapon_usp")
 
give_item(id"weapon_usp")
 
give_item(id"weapon_usp")
 
give_item(id"weapon_usp")
}
public 
glock(id) {
 
give_item(id"weapon_glock18")
 
give_item(id"weapon_glock18")
 
give_item(id"weapon_glock18")
 
give_item(id"weapon_glock18")
 
give_item(id"weapon_glock18")


by the way.. How to use register_cvar ?????????????????? For example on this plugin.. to turn it on or off?

Deviance 04-20-2007 08:43

Re: NATIVE ERROR!!!!!!!!
 
Quote:

Originally Posted by The Angel Reality (Post 467461)
#include <amxmodx>
#include <amxmisc>
#include <fun>

#define PLUGIN "Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("HLTV", "RoundStart", "a", "1=0", "2=0")
}
public RoundStart()
{
new players[1], num
get_players(players, num, "d")

new player
for(new i=0;i<num;i++)
{
player = players[i]

client_print(player, print_chat, "YOU HAVE MUCH HP!")
set_user_health(player, 999999)
}

Please learn to code before making changes in other peoples code, that wont help.


All times are GMT -4. The time now is 06:45.

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