Алексей Кашура
Участник
- Сообщения
- 15
- Реакции
- 1
Заранее извиняюсь, если не правильно назвал тему
Сделал плагин для смены персонажа по steam id
Но плагин пишет ошибки в лог сервера
Вопрос: где мой косяк в UpdateClientModel ?
Сделал плагин для смены персонажа по steam id
C-подобный:
#include <sourcemod>
#include <sdktools>
#define TEAM_SURVIVORS 2
new Handle:Timer[MAXPLAYERS+1];
new String:current_map[64];
public OnPluginStart()
{
HookEvent("player_spawn", PlayerSpawnModel);
}
public OnMapStart()
{
GetCurrentMap(current_map, sizeof(current_map));
CheckPrecacheModels("models/survivors/survivor_mechanic.mdl");
}
public Action:PlayerSpawnModel(Handle:event,const String:name[],bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (GetClientTeam(client) != TEAM_SURVIVORS) return Plugin_Continue;
{
Timer[client] = CreateTimer(1.0, UpdateClientModel, client);
}
return Plugin_Continue;
}
public Action:UpdateClientModel(Handle:timer, any:client)
{
decl String:auth[32];
GetClientAuthString(client, auth, sizeof(auth));
if (StrEqual(auth, "STEAM_1:0:1384355"))
{
SetEntProp(client, Prop_Send, "m_survivorCharacter", 3);
SetEntityModel(client, "models/survivors/survivor_mechanic.mdl");
}
Timer[client] = INVALID_HANDLE;
return Plugin_Continue;
}
public CheckPrecacheModels(String:Model[])
{
if (!IsModelPrecached(Model))
{
PrecacheModel(Model);
}
}
C-подобный:
L 11/06/2014 - 00:00:30: [SM] Native "GetClientAuthString" reported: Client 2 is not connected
L 11/06/2014 - 00:00:30: [SM] Displaying call stack trace for plugin "ec17/model_save.smx":
L 11/06/2014 - 00:00:30: [SM] [0] Line 52, model_save.sp::UpdateClientModel()
L 11/06/2014 - 00:00:30: [SM] Native "GetClientAuthString" reported: Client 2 is not connected
L 11/06/2014 - 00:00:30: [SM] Displaying call stack trace for plugin "ec17/model_save.smx":
L 11/06/2014 - 00:00:30: [SM] [0] Line 52, model_save.sp::UpdateClientModel()