View Single Post
BloodBullet
Junior Member
Join Date: May 2020
Old 05-23-2020 , 05:47   Re: fatal error 186: insufficient memory
Reply With Quote #8

Quote:
Originally Posted by Ilusion9 View Post
Search for JC_GetCaptain and fix it, remove those quotes and maybe put them inside the paranthesis ().

PHP Code:
 if("JC_GetCaptain"() == client
this is wrong
I removed the quotes and shows
PHP Code:
// E:\CSGO_ServerMain\csgo\addons\sourcemod\scripting\jailbreak_menu.sp(26) : error 017: undefined symbol "JC_GetCaptain"
// E:\CSGO_ServerMain\csgo\addons\sourcemod\scripting\jailbreak_menu.sp(121) : error 017: undefined symbol "JC_GetCaptain"
// E:\CSGO_ServerMain\csgo\addons\sourcemod\scripting\jailbreak_menu.sp(238) : error 017: undefined symbol "JC_GetCaptain"
// E:\CSGO_ServerMain\csgo\addons\sourcemod\scripting\jailbreak_menu.sp(238) : error 001: expected token: ")", but found "return" 
And to define the symbol i used "JC_GetCaptain" from this script
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <basecomm>
#include <cstrike>
#include <franug_jb>


#pragma semicolon 1


#define DATA "4.4"


new commander;

public 
APLRes:AskPluginLoad2(Handle:myselfbool:lateString:error[], err_max)
{
    
CreateNative("JC_GetCaptain"Native_Obtener);
    
    return 
APLRes_Success;
}

public 
Native_Obtener(Handle:pluginargc)
{    
        return 
commander;
}

public 
OnPluginStart()
{

    
LoadTranslations ("captain.phrases");

    
CreateConVar("sm_FranugSimon_version"DATA"version"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);

    
RegAdminCmd("sm_removesimon"command_removecaptainADMFLAG_GENERIC);
        
RegConsoleCmd("sm_simon"Co);
        
RegConsoleCmd("sm_c"Co);
        
RegConsoleCmd("sm_nosimon"unCo);
        
RegConsoleCmd("sm_noc"unCo);

    
HookEvent("round_start"roundStart);
    
HookEvent("player_death"playerDeath);
    
HookEvent("player_disconnect"playerDisconnect);


}

public 
Action:command_removecaptain(clientargs)
{
    if(
IsValidClient(commander))
    {
        
PrintToChatAll(" \x04[Jail_Simon] \x03%t""Captain has been removed by an administrator. You can now choose a new one");
        
commander = -1;
        return 
Plugin_Handled;
    }

    
PrintToChat(client" \x04[Jail_Simon] \x03%t""Captain still not exist!");

    return 
Plugin_Handled;
}

public 
Action:Co(client,args)
{
    
decl String:ronda[64];
    
JB_GetRound(ronda);
    if(!
StrEqual(ronda"Simon"false))
    {
        
PrintToChat(client" \x04[Jail_Simon] \x03Only simon is allowed the simon day!");
        return 
Plugin_Handled;
    }
    
    
    if(!
client)
        return 
Plugin_Handled;

    if(!
IsValidClient(commander))
    {
        if(
IsValidClient(client) && GetClientTeam(client) == && IsPlayerAlive(client))
        {
                   
//SetEntityRenderColor(client, 255, 150, 0, 255);
                
commander client;
                
                
FakeClientCommand(client"sm_simonmenu");
        }
        else
        {
            
PrintToChat(client" \x04[Jail_Simon] \x03%t""You must be alive or be a CT for be a captain!");
        }
    }
    else
    {
        
PrintToChat(client" \x04[Jail_Simon] \x03%t""Captain already exist!");
    }

    return 
Plugin_Handled;
}

public 
Action:unCo(client,args)
{
    if(
commander == client)
    {
           
DesNombradoC(client);
           
//SetEntityRenderColor(client, 255, 255, 255, 255);
           
commander = -1;
    }
    else
    {
       
PrintToChat(client" \x04[Jail_Simon] \x03%t""You are not the captain!");
    }
}

public 
Action:roundStart(Handle:event, const String:name[], bool:dontBroadcast
{
    
commander = -1;
    
    
decl String:ronda[64];
    
JB_GetRound(ronda);
    if(!
StrEqual(ronda"Simon"false))
    {
        return;
    }
    
    new 
client GetRandomPlayer(CS_TEAM_CT);
    if(
client 0)
    {
        
        
commander client;
        
        
FakeClientCommand(client"sm_simonmenu");
    }
    
}

GetRandomPlayer(team)
{
    new 
clients[MaxClients+1], clientCount;
    for (new 
1<= MaxClientsi++)
        if (
IsClientInGame(i) && GetClientTeam(i) == teamclients[clientCount++] = i;
        
    return (
clientCount == 0) ? -clients[GetRandomInt(0clientCount-1)];
}



public 
Action:playerDisconnect(Handle:event, const String:name[], bool:dontBroadcast
{
        new 
client GetClientOfUserId(GetEventInt(event"userid"));

    if(
client == commander)
        {
       
DesNombradoC(client);
       
commander = -1;
        }
}

public 
Action:playerDeath(Handle:event, const String:name[], bool:dontBroadcast
{
        new 
client GetClientOfUserId(GetEventInt(event"userid"));

    if(
client == commander)
        {
       
DesNombradoC(client);
       
commander = -1;
        }
}

DesNombradoC(client)
{
    
decl String:nombre[32];
    
GetClientName(clientnombresizeof(nombre));
    
PrintToChatAll(" \x04[Jail_Simon] \x03%t""no longer"nombre);
}






public 
IsValidClientclient 

    if ( !( 
<= client <= MaxClients ) || !IsClientInGame(client) ) 
        return 
false
     
    return 
true

BloodBullet is offline