Raised This Month: $51 Target: $400
 12% 

Checking the status of grenades and restoring them


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
szogun
Senior Member
Join Date: Apr 2016
Old 02-22-2023 , 10:48   Checking the status of grenades and restoring them
Reply With Quote #1

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(clientSDKHook_StartTouchHook_StartTouch);
    
SDKHook(clientSDKHook_EndTouchHook_EndTouch);
}

public 
Action Hook_StartTouch(int clientint other){
    if (!
IsValidEntity(other))
        return 
Plugin_Continue;

    
char classname[32];
    
GetEntityClassname(otherclassname32);

    if (
StrEqual(classname"trigger_teleport"))
    {
        
// Save grenade status
    
}

    return 
Plugin_Continue;
}

public 
Action Hook_EndTouch(int clientint other){
    if (!
IsValidEntity(other))
        return 
Plugin_Continue;

    
char classname[32];
    
GetEntityClassname(otherclassname32);

    if (
StrEqual(classname"trigger_teleport"))
    {
        
// Check the status of the grenades, if they have been removed, if so restore them
    
}

    return 
Plugin_Continue;

szogun is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-22-2023 , 21:52   Re: Checking the status of grenades and restoring them
Reply With Quote #2

What is game? And what map? Give a link to that.
Maybe you can edit with Stripper plugin.
__________________
Do not Private Message @me
Bacardi is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:35.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode