AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   how to change from player name to steamid ? (https://forums.alliedmods.net/showthread.php?t=320823)

burnyourfeelings 01-11-2020 07:07

how to change from player name to steamid ?
 
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;
}

OciXCrom 01-11-2020 07:41

Re: how to change from player name to steamid ?
 
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


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

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