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

[CS:S/CS:GO] Change Player's Name


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 07-02-2011 , 10:22   [CS:S/CS:GO] Change Player's Name
Reply With Quote #1

This is no longer needed. Use SetClientName in SourceMod 1.7.1 or later.

Edit: A CS:GO alternative, https://forums.alliedmods.net/showpo...2&postcount=26

A stock to successfully rename players in CS:S.

Code:
stock CS_SetClientName(client, const String:name[], bool:silent=false) {     decl String:oldname[MAX_NAME_LENGTH];     GetClientName(client, oldname, sizeof(oldname));     SetClientInfo(client, "name", name);     SetEntPropString(client, Prop_Data, "m_szNetname", name);     new Handle:event = CreateEvent("player_changename");     if (event != INVALID_HANDLE)     {         SetEventInt(event, "userid", GetClientUserId(client));         SetEventString(event, "oldname", oldname);         SetEventString(event, "newname", name);         FireEvent(event);     }     if (silent)         return;         new Handle:msg = StartMessageAll("SayText2");     if (msg != INVALID_HANDLE)     {         BfWriteByte(msg, client);         BfWriteByte(msg, true);         BfWriteString(msg, "Cstrike_Name_Change");         BfWriteString(msg, oldname);         BfWriteString(msg, name);         EndMessage();     } }

Last edited by GoD-Tony; 07-22-2015 at 01:49.
GoD-Tony is offline
 



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 18:06.


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