Raised This Month: $ Target: $400
 0% 

plugin jailbreak


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Diversity
AlliedModders Donor
Join Date: Jan 2018
Location: Constanta, Romania
Old 05-20-2018 , 12:17   plugin jailbreak
Reply With Quote #1

an opinion?
i am beginner in sourcemod.

PHP Code:
/*

Credits:
            Vaggelis - Open Cells

*/

#include <sourcemod>
#include <sdktools> 

// New's

new Float:min 300.0
new Handle:g_doorlist

bool is_Simon
[MAXPLAYERS+1] = false
int Is_Simon 
= -1

// Define's

#define CS_TEAM_CT 1
#define CS_TEAM_T  2

// Plugin Info
 
public Plugin myinfo 
{
    
name "JailBreak Main ( Alpha )",
    
author "Diversity",
    
description "Pluginul de baza pentru JailBreak CS:GO",
    
version "0.0.1",
    
url "http://www.sourcemod.net/"
};

// Start

public void OnPluginStart() 

    
g_doorlist CreateArray()
    
    
RegConsoleCmd("sm_cells"CmdCells)

    
HookEvent("round_start"Event_RoundStart)
    
HookEvent("round_end"Event_RoundEnd)
    
HookEvent("player_death"Event_PlayerDeath)
    
HookEvent("player_spawn"Event_OnPlayerSpawn)
}

// Public's

public OnMapStart()
{      
    
CacheDoors()
}

public 
OnMapEnd()
{
    
Reset_Simon()

    
ClearArray(g_doorlist)
}

// Event's

public void Event_PlayerDeath(Event event, const char[] namebool dontBroadcast)
{
   
int victim_id event.GetInt("userid")
   
//int attacker_id = event.GetInt("attacker")
 
   
int victim GetClientOfUserId(victim_id)
   
//int attacker = GetClientOfUserId(attacker_id)

   
if(victim == Is_SimonReset_Simon()
}

public 
void Event_RoundStart(Event event, const char[] namebool dontBroadcast)

    
Reset_Simon()
}

public 
void Event_RoundEnd(Event event, const char[] namebool dontBroadcast)
{
    
Reset_Simon()
}

public 
Action Event_OnPlayerSpawn(Event event, const char[] namebool bDontBroadcast
{
    
int client GetClientOfUserId(event.GetInt("userid")); 

    if(
GetClientTeam(client) != CS_TEAM_CT)
        return 
Plugin_Continue

    
Reset_Simon()

    return 
Plugin_Continue;
}


// Function's

CacheDoors()
{
    new 
ent
    
new door
    
    
while((ent FindEntityByClassname(ent"info_player_terrorist")) != -1)
    {
        new 
Float:coor[3]
        
GetEntPropVector(entProp_Data"m_vecOrigin"coor)
        
        while((
door FindEntityByClassname(door"func_door")) != -1)
        {
            new 
Float:posi[3]
            
GetEntPropVector(doorProp_Data"m_vecOrigin"posi)
            
            if(
GetVectorDistance(posicoor) < min)
            {
                
min GetVectorDistance(posicoor)
            }
        }
    }
    
    
ent = -1
    door 
= -1
    
    min 
+= 80.0
    
    
while((ent FindEntityByClassname(ent"info_player_terrorist")) != -1)
    {
        new 
Float:coor[3]
        
GetEntPropVector(entProp_Data"m_vecOrigin"coor)
        
        while((
door FindEntityByClassname(door"func_door")) != -1)
        {
            new 
Float:posi[3]
            
GetEntPropVector(doorProp_Data"m_vecOrigin"posi)
            
            if(
GetVectorDistance(posicoor) <= min)
            {
                
PushArrayCell(g_doorlistdoor)
            }
        }
    }
}

OpnCell()
{
    for(new 
0GetArraySize(g_doorlist); i++)
    {
        new 
temp GetArrayCell(g_doorlisti)
        
AcceptEntityInput(temp"Use")
    }
}

Reset_Simon() 
{
    
/*
    
    Is_Simon este "id-ul" playerului care are simon iar is_Simon este daca acel player este simon.

    */
    
if(Is_Simon > -1
    {
        
is_Simon[Is_Simon] = false
        Is_Simon 
= -
    
}
}

void Set_Simon(int client = -1)
{
    new 
team GetClientTeam(client);  

    if(
team != CS_TEAM_CT) return PrintToChat(client"Nu esti politist.")
    if(
client == -1) return PrintToChat(client"#0001")
    if(
Is_Simon > -1) return PrintToChat(client"Este deja un simon.")

    
Is_Simon client
    is_Simon
[Is_Simon] = true

    PrintToChat
(client"Acum esti Simon. Trebuie sa dai comenzi.");
    for(new 
1MaxClientsi++) PrintToChat(i"Noul simon este %s, ascultati-l!"Get_Name(Is_Simon))
    
// Menu_Simon(client) 

    
return Plugin_Continue;
}

char Get_Name(int client)
{
    
char name[MAX_NAME_LENGTH];
 
    
GetClientName(clientnamesizeof(name));
    return 
name;
}

// Command's

public Action:CmdCells(clientargs)
{
    if(
is_Simon[Is_Simon] == true || GetUserFlagBits(client) & ADMFLAG_KICK)
    {
        
OpnCell();
        
        new 
String:name[32]
        
GetClientName(clientnamesizeof(name))
        
PrintToChatAll("%s opened cells."name)
    }
}

public 
Action OnClientCommand(int clientint args)
{
    
char cmd[16];
    
GetCmdArg(0cmdsizeof(cmd));    /* Get command name */
 
    
if (StrEqual(cmd"simon"))
    {
        
Set_Simon(client)
        return 
Plugin_Handled
    
}
 
    return 
Plugin_Continue;

Diversity is offline
Vaggelis
Senior Member
Join Date: May 2017
Old 05-20-2018 , 12:27   Re: plugin jailbreak
Reply With Quote #2

Opinion for what?
Vaggelis is offline
Diversity
AlliedModders Donor
Join Date: Jan 2018
Location: Constanta, Romania
Old 05-20-2018 , 12:34   Re: plugin jailbreak
Reply With Quote #3

i am beginner in sourcemod.

for plugin, it's ok?
Diversity is offline
Vaggelis
Senior Member
Join Date: May 2017
Old 05-20-2018 , 12:42   Re: plugin jailbreak
Reply With Quote #4

https://forums.alliedmods.net/showthread.php?t=303498, download jailbreak.sp and check the "Simon" parts only
Vaggelis is offline
ThatKidWhoGames
Veteran Member
Join Date: Jun 2013
Location: IsValidClient()
Old 05-23-2018 , 07:45   Re: plugin jailbreak
Reply With Quote #5

Make sure to take a look at the wiki for the new syntax. Looking at your code, the old and new syntax are mixed together which could (potentially) lead to issues.
ThatKidWhoGames 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 05:33.


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