Whenever a player spawns with a certain of mine plugin loaded the server crashes. (This is only since the update.) Here's what that plugin does when a player spawns.
PHP Code:
public PlayerSpawnEvent(Handle:event, const String:name[], bool:dontBroadcast)
{
if (GetConVarInt(g_Cvar_Enable))
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (IsPlayerAlive(client))
{
SetEntityRenderColor(client, 255, 255, 255, 255);
IsCuffed[client] = false;
Warranted[client] = false;
new String:plyr_class[32];
new String:plyr_gender[16];
new String:plyr_team[32];
GetPlayerClassTeam(client, playerinfokv, plyr_class, plyr_team);
// Check how much money they have. If they are new give them $500.
money[client] = KvGetNum(playerinfokv, "Money", 500);
KvGetString(playerinfokv, "Gender", plyr_gender, sizeof(plyr_gender), "Male");
team[client] = plyr_team;
PrintToChat(client, "\x03[RP] You are a %s %s, and you have $ %i.", plyr_gender, plyr_class, money[client]);
PrintToChat(client, "\x03[RP] Your team is %s.", plyr_team);
if(StrEqual(plyr_team, "Government", false))
{
CS_SwitchTeam(client, 3);
} else CS_SwitchTeam(client, 2);
KvSetNum(playerinfokv, "Money", money[client]);
new MoneyOffset = FindSendPropOffs("CCSPlayer", "m_iAccount");
SetEntData(client, MoneyOffset, money[client], 4, true);
// Figure out their class info (They have now been spawned and know thier stuff.)
KvJumpToKey(classmenukv, plyr_team, false);
KvGotoFirstSubKey(classmenukv, true);
// Why is it like this? I have no idea. Scroll through class menu and find player's class.
decl String:buffer[30];
KvGetSectionName(classmenukv, buffer, sizeof(buffer));
new match = (strcmp(buffer, plyr_class, false));
if (match != 0)
{
do
{
KvGetSectionName(classmenukv, buffer, sizeof(buffer));
match = (strcmp(buffer, plyr_class, false));
} while ((match != 0) && (KvGotoNextKey(classmenukv)));
}
// Now choose model according to gender. Assume male if not chosen.
new String:plyr_model[256];
if (strcmp(plyr_gender, CMD_MALE) == 0)
{
KvGetString(classmenukv, "model_m", plyr_model, sizeof(plyr_model));
if (!StrEqual(plyr_model,""))
{
if (IsModelPrecached(plyr_model))
{
SetEntityModel(client, plyr_model);
}
else if (!IsModelPrecached(plyr_model))
{
PrecacheModel(plyr_model);
SetEntityModel(client, plyr_model);
}
}
else LogMessage("[RP Debug] Error in classes.ini for model_m of %s.", plyr_class);
}
else if (strcmp(plyr_gender, CMD_FEMALE) == 0)
{
KvGetString(classmenukv, "model_f", plyr_model, sizeof(plyr_model));
if (!StrEqual(plyr_model,""))
{
if (IsModelPrecached(plyr_model))
{
SetEntityModel(client, plyr_model);
}
else if (!IsModelPrecached(plyr_model))
{
PrecacheModel(plyr_model);
SetEntityModel(client, plyr_model);
}
}
else LogMessage("[RP Debug] Error in classes.ini for model_f of %s.", plyr_class);
}
KvRewind(classmenukv);
KvRewind(playerinfokv);
// If custom spawns are enabled and there is a custom spawn config, teleport them to a spawn for their team.
if ((GetConVarInt(g_useSpawns)) && (g_useSpawns2 = true))
{
KvGotoFirstSubKey(classmenukv, true);
decl String:buffer9[30];
new i = -1;
new match2 = (strcmp(buffer9, plyr_team, false));
do
{
i++;
KvGetSectionName(classmenukv, buffer9, sizeof(buffer));
match2 = (strcmp(buffer9, plyr_team, false));
} while ((match2 != 0) && (KvGotoNextKey(classmenukv)));
KvRewind(classmenukv);
new spawn_here = -1;
do
{
spawn_here = GetRandomInt(0, g_SpawnQty);
} while (g_SpawnTeam[spawn_here] != i);
TeleportEntity(client, g_SpawnLoc[spawn_here], NULL_VECTOR, NULL_VECTOR);
}
new String:fuck[64];
GetClientName(client, fuck, sizeof(fuck));
ServerCommand("sm_disarm \"%s\"", fuck);
GivePlayerItem(client, WPN_KNFE);
}
}
}
Does any of that look like it might make a server want to crash? Here's the crash error I get:
Also, where would I check to see what kind of changes need to be made to my plugins every time there's a big SM update so I don't have to come in here asking for help?