Raised This Month: $ Target: $400
 0% 

Where does this id variable come from?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
chinga
Junior Member
Join Date: May 2021
Old 05-17-2021 , 15:40   Where does this id variable come from?
Reply With Quote #1

Hi,

I'm trying to edit the Pug Mod by Smiley:
https://forums.alliedmods.net/showthread.php?t=217539

What I want to do is that players who join the server will automatically be ready, so I added copied the function of force ready by admin:

PHP Code:
public PUG_ForceReady(id,iLevel)
{
    if(
g_bReadySystem && access(id,iLevel))
    {
        new 
szName[MAX_NAME_LENGTH];
        
read_argv(1,szName,charsmax(szName));
        
        new 
iPlayer cmd_target(id,szName,CMDTARGET_OBEY_IMMUNITY);
        
        if(
iPlayer)
        {
            
PUG_CommandClient(id,"!forceready","PUG_FORCE_READY",iPlayer,PUG_Ready(iPlayer));
        }
    }
    
    return 
PLUGIN_HANDLED;


And changed it a little bit to automatically be called when a user connects.
So I removed anything related to admin:

PHP Code:
public PUG_ForceReadyAuto(id)
{
    if(
g_bReadySystem && access(idl))
    {
        new 
szName[MAX_NAME_LENGTH];
        
read_argv(1,szName,charsmax(szName));
        
        new 
iPlayer cmd_target(id,szName);
        
        if(
iPlayer)
        {
            
PUG_CommandClient(id,"!forceready","PUG_FORCE_READY",iPlayer,PUG_Ready(iPlayer));
        }
    }
    
    return 
PLUGIN_HANDLED;



But there a few things I don't understand: Where does this id variable come from? And also, who calls these functions? In this file no one is calling these functions so I am not sure where it comes from. I searched every where in the .sma files but there is no where in the code where these functions are being called (Not the one I created, but the other ones such as PUG_ForceReady
chinga is offline
 



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 02:34.


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