View Single Post
CodeMonkey
Junior Member
Join Date: Dec 2009
Old 01-17-2011 , 16:08   Re: Showing sprites above players head
Reply With Quote #20

Alright so after I've gotten my sprites spawned and their (somewhat) attached to their parent. How do I get this SetTransmit to work.

I've been trying this

PHP Code:
stock CreateSprite(iClientString:sprite[], Float:offset)
{
    new 
String:szTemp[64]; 
    
Format(szTempsizeof(szTemp), "client%i"iClient);
    
DispatchKeyValue(iClient"targetname"szTemp);

    new 
Float:vOrigin[3];
    
GetClientAbsOrigin(iClientvOrigin);
    
vOrigin[2] += offset;
    
//new ent = CreateEntityByName("env_sprite_oriented");
    
new ent CreateEdict();
    if (
ent)
    {
        new 
String:StrEntityName[64]; Format(StrEntityNamesizeof(StrEntityName), "ent_sprite_oriented_%i"ent);
        
DispatchKeyValue(ent"model"sprite);
        
DispatchKeyValue(ent"classname""env_sprite_oriented");
        
DispatchKeyValue(ent"spawnflags""1");
        
DispatchKeyValue(ent"scale""0.1");
        
DispatchKeyValue(ent"rendermode""1");
        
DispatchKeyValue(ent"rendercolor""255 255 255");
        
//DispatchKeyValue(ent, "targetname", StrEntityName);
        
DispatchKeyValue(ent"parentname"szTemp);
        
DispatchSpawn(ent);
        
        
//SetVariantString(szTemp);
        //AcceptEntityInput(ent, "SetParent", ent, ent, 0);
        
        
        
TeleportEntity(entvOriginNULL_VECTORNULL_VECTOR);

        
g_EntList[iClient] = ent;
        
SDKHook(entSDKHook_SetTransmitSetTransmit);
    }

With my SetTransmit method looking like this:
PHP Code:
public Action:SetTransmit(entityclient) {
    
PrintToChatAll("Entity: %d - Client: %N",entity,client);

    return 
Plugin_Continue;
    

Yet I get no output at all from the server.
CodeMonkey is offline