Raised This Month: $32 Target: $400
 8% 

Solved Set special info for player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 07-31-2017 , 11:51   Set special info for player
Reply With Quote #1

I want to set an info for 1 player and only on that PC only (Like a special reward and prevent to share it).

I used set_user_info and get_user_info but I think it didn't work

PHP Code:
public test(id)
{
    static 
name[35]; 
    
    for(new 
1g_MaxPlayersi++)
    {
        
get_user_name(idnamecharmaxs(name))

        if(
equal(name"Celena  Luna"))
        {
            
set_user_info(id"_sp""656")
            break
        }
    }
}

public 
client_putinserver(id)
{
    new 
info[5]
    
get_user_info(id"_sp"infocharmaxs(info))
    if(
str_to_num(info) == 656)
        
g_special[id] = true

__________________
My plugin:

Last edited by Celena Luna; 08-02-2017 at 03:22.
Celena Luna is offline
leonardo121
Member
Join Date: Sep 2013
Old 07-31-2017 , 12:21   Re: Set special info for player
Reply With Quote #2

try
PHP Code:
get_user_name(idnamecharmaxs(name)) 


PHP Code:
get_user_name(idnamecharmax(name)) 
--
why this is starting with 1 ?
PHP Code:
 for(new 1g_MaxPlayersi++) 
__________________
" In the end it doesn't even matter " - Linkin Park

Last edited by leonardo121; 07-31-2017 at 12:24.
leonardo121 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-31-2017 , 13:25   Re: Set special info for player
Reply With Quote #3

No such thing is charmaxs its charsmax and use get players will return in array all the connected players

And you method is bad to set your access if your name.. Is celna etc.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 07-31-2017 at 14:53.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
wickedd
Veteran Member
Join Date: Nov 2009
Old 07-31-2017 , 13:47   Re: Set special info for player
Reply With Quote #4

It would be a lot easier if you use the player SteamID.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 07-31-2017 , 17:39   Re: Set special info for player
Reply With Quote #5

Quote:
Originally Posted by leonardo121 View Post
try
PHP Code:
get_user_name(idnamecharmaxs(name)) 


PHP Code:
get_user_name(idnamecharmax(name)) 
I wrote too fast xD

Quote:
Originally Posted by leonardo121 View Post
why this is starting with 1 ?
PHP Code:
 for(new 1g_MaxPlayersi++) 
I usually start with 0 but sometime it got Out of Range so I try to start with 1 this time

Quote:
Originally Posted by Natsheh View Post
And you method is bad to set your access if your name.. Is celna etc.
I use player name to test (just too lazy to get steamid).
Why it is bad anyway? :<

Quote:
Originally Posted by wickedd View Post
It would be a lot easier if you use the player SteamID.
Like I said, I want it on 1 computer only (well if he didn't know of course ) so I check both SteamID and an info.
__________________
My plugin:

Last edited by Celena Luna; 07-31-2017 at 17:42.
Celena Luna is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-31-2017 , 17:42   Re: Set special info for player
Reply With Quote #6

0 is the server id/worldspawn. And 1 is the first playerslot id.

Did you paid an attention at my previous post?
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 07-31-2017 at 17:44.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 07-31-2017 , 17:57   Re: Set special info for player
Reply With Quote #7

Quote:
Originally Posted by Natsheh View Post
0 is the server id/worldspawn. And 1 is the first playerslot id.

Did you paid an attention at my previous post?
PHP Code:
static Players[32], iNumSteamID[10]
get_players(PlayersiNum)
for (new 
0iNum; ++i)
{
    
//get_user_name(id, name, charsmax(name)) 
    
get_user_authid(idSteamIDcharsmax(SteamID)

        if(
equal(SteamIDsp_player)) 
        { 
            
set_user_info(id"_sp""656"
            break 
        }
}

public 
client_putinserver(id

    new 
info[5
    
get_user_info(id"_sp"infocharsmax(info)) 
    if(
str_to_num(info) == 656
        
g_special[id] = true 

__________________
My plugin:

Last edited by Celena Luna; 07-31-2017 at 17:57.
Celena Luna is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-31-2017 , 18:15   Re: Set special info for player
Reply With Quote #8

PHP Code:
new Players[32], iNumSteamID[32]
get_players(PlayersiNum)
for (new 
iPlayeriNumi++)
{
     
Player Players[i]
    
//get_user_name(id, name, charsmax(name)) 
    
get_user_authid(PlayerSteamIDcharsmax(SteamID)

        if(
equal(SteamIDsp_player)) 
        { 
            
set_user_info(id"_sp""656"
            break 
        }

Here you go anyway your whole idea its seems for nonsteam unfortunately
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
wickedd
Veteran Member
Join Date: Nov 2009
Old 07-31-2017 , 19:50   Re: Set special info for player
Reply With Quote #9

This is a bad idea. Because if the player config.cfg is set to read only, this will only last until he closes CS.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Old 08-01-2017, 13:50
Black Rose
This message has been deleted by Black Rose. Reason: Not important
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 08-02-2017 , 03:22   Re: Set special info for player
Reply With Quote #10

Yeah, it is bad idea. I will think about other way
__________________
My plugin:
Celena Luna 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 20:25.


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