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