AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Used AMXXEasy X :: Need Help (https://forums.alliedmods.net/showthread.php?t=55696)

[CFF] gr3ed 05-27-2007 20:52

Used AMXXEasy X :: Need Help
 
I was hoping it'd help me(it didn't) and made a simple plugin. I add "return PLUGIN_HANDLED;" since it does not seem to add that and a few other minor details. But in all....dunno what I'm doing and I'm guessing part of this code is wrong for sure. If someone could help....thanks.
Code:

#include <amxmodx>
#include <amxmisc>
#include <fun>
// First plugin

#define PLUGIN "amx_random"
#define VERSION "1.0"
#define AUTHOR "gr3ed"


public plugin_init()
{
    register_plugin("PLUGIN","VERSION","AUTHOR")

    register_event("ResetHUD","event_spawn","be")
}

public client_connect(id)
{
    client_print(0,print_chat,"%s Has Joined The Game!")
}


public event_spawn(id)
{
    give_item(id,"42");

    return PLUGIN_HANDLED;
}

Also if you could add comments to explain to me what it all means. Thanks again.

Lee 05-27-2007 21:04

Re: Used AMXXEasy X :: Need Help
 
Code:
public client_connect(id) {     new player_name[35]     get_user_name(id, player_name, 34)      client_print(0, print_chat, "%s has joined the server.", player_name) }
As for player spawn; http://forums.alliedmods.net/showthread.php?t=42159.

Cheap_Suit 05-27-2007 21:08

Re: Used AMXXEasy X :: Need Help
 
PHP Code:

public plugin_init()
{
 
// you dont need  " 
 
register_plugin(PLUGIN,VERSION,AUTHOR)
 
// an event which is triggered when players spawns
 
register_event("ResetHUD","event_spawn","be")
}
public 
client_connect(id)
{
 
// a string to store the players name.
 
new name[32]
 
 
// a function to get the user's name.
 
get_user_name(idname31)
 
 
// prints your message
 
client_print(0,print_chat,"%s Has Joined The Game!"name)
}
 
public 
event_spawn(id)
{
 
//you need a small delay just to make sure it gives your weapon
 
 
set_task(0.1"give_weapon"id)
 
}
public 
give_weapon(id)
{
 
//you need the weapons name in here
 //an example would be give_item(id,"weapon_deagle")
 
give_item(id,"42"// so what ever weapon 42 is



Lee 05-27-2007 21:12

Re: Used AMXXEasy X :: Need Help
 
I thought you weren't supposed to rely solely on ResetHUD to detect player spawn as per VEN's tutorial..

Cheap_Suit 05-27-2007 21:29

Re: Used AMXXEasy X :: Need Help
 
You just need to add few more checks, I didnt add it because I try to make it as simple as possible.

regalis 05-27-2007 21:34

Re: Used AMXXEasy X :: Need Help
 
1 Attachment(s)
For CS there is not weapon with number 42...
(The answer of all questions is......42*lol*)

Now here is a list of all weapons and its data...maybe its of interest!?

greetz regalis

[CFF] gr3ed 05-28-2007 00:30

Re: Used AMXXEasy X :: Need Help
 
*smacks head* I'm sorry. xD Thanks everyone for this help! Heh...42 is the answer to everything for idiots like me;)

Quote:

Originally Posted by regalis (Post 482711)
For CS there is not weapon with number 42...
(The answer of all questions is......42*lol*)

Now here is a list of all weapons and its data...maybe its of interest!?

greetz regalis



All times are GMT -4. The time now is 10:37.

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