Hey is there any person who would help me with this code to do the saving of grenade status and its restoration, unfortunately I am using maps where we have portals etc and they unfortunately remove grenades for the player.
PHP Code:
#include <sourcemod>
#include <SDKHook>
#pragma semicolon 1
#pragma newdecls required
public void OnClientPostAdminCheck(int client){
SDKHook(client, SDKHook_StartTouch, Hook_StartTouch);
SDKHook(client, SDKHook_EndTouch, Hook_EndTouch);
}
public Action Hook_StartTouch(int client, int other){
if (!IsValidEntity(other))
return Plugin_Continue;
char classname[32];
GetEntityClassname(other, classname, 32);
if (StrEqual(classname, "trigger_teleport"))
{
// Save grenade status
}
return Plugin_Continue;
}
public Action Hook_EndTouch(int client, int other){
if (!IsValidEntity(other))
return Plugin_Continue;
char classname[32];
GetEntityClassname(other, classname, 32);
if (StrEqual(classname, "trigger_teleport"))
{
// Check the status of the grenades, if they have been removed, if so restore them
}
return Plugin_Continue;
}