Raised This Month: $ Target: $400
 0% 

how to change from player name to steamid ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
burnyourfeelings
New Member
Join Date: Jan 2020
Old 01-11-2020 , 07:07   how to change from player name to steamid ?
Reply With Quote #1

I have a plugin wich save some points on playername but i want to change it to steamid, how i can make this ?

SQL line : public SQL_SaveUserPoints(Player)
{
new SQL[256];
formatex(SQL, charsmax(SQL), "UPDATE PlayersData SET Points = '%d' WHERE PlayerName = '%s'", g_Points[Player], g_Name[Player]);
SQL_ThreadQuery(_SQLTuple, "SQL_Ignore", SQL);
}

give points line :

if(Attacker == Victim)
{
if(g_Points[Attacker] >= 5)
{
g_Points[Attacker] -= 5;
_PrintToChat(Attacker, "^x04[BALCANI]^x01 Ai primit^x03 -5^x01 pentru sinucidere. Acum ai in total^x04 %d^x01 puncte.", g_Points[Attacker]);
}

return;
}
burnyourfeelings is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-11-2020 , 07:41   Re: how to change from player name to steamid ?
Reply With Quote #2

You can just modify the saving part. Of course you need to load it by SteamID as well.

Use "get_user_authid" to get the player's SteamID and pass it in the "formatex" line where the SQL statement is located, instead of "g_Name".

Or simply use a better plugin that does the same job - https://forums.alliedmods.net/showthread.php?t=308540
__________________

Last edited by OciXCrom; 01-11-2020 at 07:42.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Reply


Thread Tools
Display Modes

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 03:00.


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