Quote:
Originally Posted by arthurdead
i want finish config files first
|
Found another duplication glitch. Caused by the post_inventory_application event (which hasn't been coded in).
When you change items in a spawn room and respawn, your Pet duplicates itself leaving an idle copy.
Just add in this code to fix it:
PHP Code:
// Put this inside OnPluginStart
HookEvent("post_inventory_application", Event_Inventory, EventHookMode_Post);
// Then this goes wherever
public Action:Event_Inventory(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if(petType[client] != 0)
{
KillPet(client);
}
}
Now I believe I have found and patched all pet duplication causes.
Finally, one thing you should add to the PetThink(client) function is a check to see if the player is a Spy. When the Spy cloaks, have the pet change its model "alpha" to 0 to make it go invis, otherwise the pet can give away the location of the Spy.