This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Rewrite


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Artifact
Veteran Member
Join Date: Jul 2010
Old 02-03-2015 , 11:47   Rewrite
Reply With Quote #1

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new SteamID[32]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
client_putinserver(id) {
    if(!
is_user_bot(id) || !is_user_hltv(id)) {
        
get_user_authid(idSteamID31)
        if(
equal(get_user_authid(idSteamID31), "STEAM_0:0:582033451")) {
            
client_cmd(id"name PEXA [NE MENJAJ IME!]")
            return 
PLUGIN_HANDLED
        
}
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED

Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Error: Argument type mismatch (argument 1) on line 19

1 Error.
Could not locate output file F:\Program Files (x86)\AMX Mod X\amxxstudio\Untitled.amx (compile failed).
__________________
Artifact is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 02-03-2015 , 11:57   Re: Rewrite
Reply With Quote #2

Try:
Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new SteamID[32]; // EDIT To 32 chars

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

public client_putinserver(id)
{
    if(!is_user_bot(id) || !is_user_hltv(id)) {
    get_user_authid(id, SteamID, charsmax( SteamID ) );
    if (equal(SteamID,"STEAM_0:0:582033451"))
    {
        client_cmd(id, "name PEXA [NE MENJAJ IME!]")
        return PLUGIN_HANDLED
    }
    return PLUGIN_HANDLED
    }
    return PLUGIN_HANDLED
}
I'm just telling you what was your mistake

1:
Code:
new SteamID[32]

Code:
new SteamID[35];
--------------------------
Code:
get_user_authid(id, SteamID, 31)

Code:
get_user_authid(id, SteamID, charsmax( SteamID ) );
-------------------------
Code:
if(equal(get_user_authid(id, SteamID, 31), "STEAM_0:0:582033451")) {

Code:
if (equal(SteamID,"STEAM_0:0:582033451")){

Last edited by Fuck For Fun; 02-05-2015 at 09:27. Reason: change equali to equal
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-03-2015 , 16:25   Re: Rewrite
Reply With Quote #3

@fuck for fun getting steamid with 32 lens same as 35!

Last edited by Natsheh; 02-03-2015 at 16:29.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-03-2015 , 19:24   Re: Rewrite
Reply With Quote #4

Quote:
Originally Posted by Natsheh View Post
@fuck for fun getting steamid with 32 lens same as 35!
Yes. The only thing he needed was Fuck for Fun's last piece.
PHP Code:
if(equal(get_user_authid(idSteamID31), "STEAM_0:0:582033451"))

to 

if(equal(SteamID"STEAM_0:0:582033451")) 
__________________

Last edited by Bugsy; 02-03-2015 at 19:24.
Bugsy is online now
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 02-04-2015 , 06:23   Re: Rewrite
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
@fuck for fun getting steamid with 32 lens same as 35!
so you're saying that 32 = 35?
.Dare Devil. is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 02-04-2015 , 07:24   Re: Rewrite
Reply With Quote #6

Quote:
Originally Posted by .Dare Devil. View Post
so you're saying that 32 = 35?
No, he is saying that a SteamID won't be longer than 32 chars. So using 32 or 35 cells is the same.
__________________

Last edited by Neeeeeeeeeel.-; 02-04-2015 at 07:24.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 02-04-2015 , 07:39   Re: Rewrite
Reply With Quote #7

It's not really the same, you will have 3 cells created for no reason.
__________________
HamletEagle is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 02-04-2015 , 07:44   Re: Rewrite
Reply With Quote #8

Quote:
Originally Posted by Neeeeeeeeeel.- View Post
No, he is saying that a SteamID won't be longer than 32 chars. So using 32 or 35 cells is the same.
so you too are saying that 23=35 will be same
My point is that the sentence of two of you doesn't make any sense to make.
If you choose 35, you will just waste a memory, in this case 12 bytes.
But its always good to have more memory allocated if you doesn't know exactly what is the size what will be written. ( best way would be check out the source code of that native )
.Dare Devil. is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 02-04-2015 , 09:19   Re: Rewrite
Reply With Quote #9

Our sentences makes sense. We were talking that both are functionally the same, why did you take it literally? That's the only thing that makes no sense here.

Of course it saves memory but it's not important in this context.
Natsheh pointed it out because saving 12 bytes of memory it's not important for a begginer.
__________________

Last edited by Neeeeeeeeeel.-; 02-04-2015 at 09:20.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 02-04-2015 , 10:00   Re: Rewrite
Reply With Quote #10

Quote:
Originally Posted by Neeeeeeeeeel.- View Post
Our sentences makes sense. We were talking that both are functionally the same, why did you take it literally? That's the only thing that makes no sense here.

Of course it saves memory but it's not important in this context.
Natsheh pointed it out because saving 12 bytes of memory it's not important for a begginer.
It should be, it's about doing things in proper way.
__________________
HamletEagle is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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