AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Errors Compiling Cant FIgure it out! (https://forums.alliedmods.net/showthread.php?t=22692)

Styles 01-01-2006 20:43

Errors Compiling Cant FIgure it out!
 
Code:
<amxmodx> <amxmisc> <cstrike> <engine> #DEFINE PLUGIN_NAME "Name Changer" #DEFINE PLUGIN_VERSION "1.0" #DEFINE PLUGIN_AUTHOR "hYp3r" #DEFINE [MAXNAMES] "3" #DEFINE newPlayerName "www.1HitKill.com" public plugin_init {    register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);    register_event("CurWeapon", "Weapon_check", "be") ; } public Weapon_check(id) {    new name    cs_get_user_name(id, name, 32);    new allowednames[MAXNAMES][3] = {       "empty",       "Player",       "player" }    if(equali(allowednames, name) {    client_cmd("name %s, newPlayerName")    return_PLUGIN }

Doesnt compile right please help me and look at it/

thanks.!

SubFive 01-01-2006 20:51

It needs to be

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <engine>

Brad 01-01-2006 20:52

Instead of generically asking for help, tell people what kind of compile errors you're getting.

Edit: There's just about something wrong with every line of code you have there. Look at how other plugins do things and then try again.

Kensai 01-01-2006 20:52

Lmfao. I think you should just delete this and start over. I lost count of how many errors are in there bud.

Code:
public plugin_init {

Missing ()

Etc.

SubFive 01-01-2006 20:54

Re: Errors Compiling Cant FIgure it out!
 
Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <engine> #DEFINE PLUGIN_NAME "Name Changer" #DEFINE PLUGIN_VERSION "1.0" #DEFINE PLUGIN_AUTHOR "hYp3r" #DEFINE [MAXNAMES] "3" #DEFINE newPlayerName "www.1HitKill.com" public plugin_init {    register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);    register_event("CurWeapon", "Weapon_check", "be") ; } public Weapon_check(id) {     new name     cs_get_user_name(id, name, 32);     new allowednames[MAXNAMES][3] = {     "empty",     "Player",     "player"     }     if(equali(allowednames, name)     {         client_cmd("name %s, newPlayerName")     } }

That should fix some errors.

v3x 01-01-2006 20:55

This took me 6 days and 7 nights to fix:
Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN_NAME "Name Changer" #define PLUGIN_VERSION "1.0" #define PLUGIN_AUTHOR "hYp3r" #define MAXNAMES 3 #define newPlayerName "www.1HitKill.com" public plugin_init() {    register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR); } new allowednames[MAXNAMES][] = {       "empty",       "Player",       "player" } public client_infochanged(id) {    new name[32]    get_user_name(id, name, 32);    for(new i = 0; i < MAXNAMES; i++)    {       if(equali(allowednames[i], name))        client_cmd(id, "name %s", newPlayerName)    } }



:rtfm:

Xanimos 01-01-2006 23:15

1) That checks if their old name is allowed or not.
2) You should check if their old name (get_user_name()) and new name (get_user_info( id , "name",...)) are different before you check to see if they are allowed.

Styles 01-02-2006 00:24

ok thanks for the tip! and thanks for your help osrry learning to code not an expert...


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

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