Raised This Month: $ Target: $400
 0% 

Need help for complied errors


Post New Thread Reply   
 
Thread Tools Display Modes
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 03-04-2019 , 15:06   Re: Need help for complied errors
Reply With Quote #11

Quote:
Originally Posted by reid123455 View Post
Wow, thanks a lot.
I really appreciate it, it's working perfectly.
But I still don't understand why I get errors if using my compiler.

impossible_cc's version can be compiled in this website, but plugin still failed to work
without any errors.

But thank you guys. I've learned a lot from these threads.
oops, my version doesnt work because you need a short timer after player_spawn event (I think so).

I'm not sure, but I think that in Cruze's plugin if someone joins server when warmup is already started, or he dies somehow and then respawns again (for example joins spectator then switchs back to team), he won't be freezed. Tell me if I'm wrong.

Still not tested, sorry if it doesnt work.

PHP Code:

#include <sourcemod> 
#include <sdktools> 

public Plugin myinfo =  

    
name "Warmup Waiting"
    
author "Reid"
    
description "Simple plugin for waiting other player's connecting by restricting movement"
    
version "0.0.1"
    
url "" 
};

public 
void OnMapStart() 
{
    
float GetWarmUpTime = (FindConVar("mp_warmuptime")).FloatValue
    if(
GetWarmUpTime 0.0)
    {
        
HookEvent("player_spawn"OnPlayerSpawnEventHookMode_Post);
        
        
CreateTimer(GetWarmUpTimeWarmUpOver);
    }


public 
void OnPlayerSpawn(Event event, const char[] namebool dontBroadcast
{
    
CreateTimer(0.0PlayerSpawnDelayedevent.GetInt("userid"));


public 
Action PlayerSpawnDelayed(Handle timerint userid)
{
    
int client GetClientOfUserId(userid);
    
    if(
IsClientInGame(client) && IsPlayerAlive(client))
    {
        
SetEntityMoveType(clientMOVETYPE_NONE);  
    }
    
    
PrintCenterText(client"Please wait for other players connect"); 
    
PrintToChat(client"Please wait for other players connect."); 
}

public 
Action WarmUpOver(Handle timer
{
    
UnhookEvent("player_spawn"OnPlayerSpawnEventHookMode_Post);        //We don't need it anymore, so unhook.
    
    
for(int i 1<= MaxClientsi++) 
    { 
        if (
IsClientInGame(i) && IsPlayerAlive(i)) 
        { 
            
SetEntityMoveType(iMOVETYPE_WALK);  
        } 
    }
    
    
PrintCenterTextAll("Game is going to start!"); 
    
PrintToChatAll("Game is going to start!"); 


Last edited by impossible_cc; 03-04-2019 at 15:26. Reason: fixing terrible English
impossible_cc is offline
reid123455
Junior Member
Join Date: May 2015
Old 03-05-2019 , 06:06   Re: Need help for complied errors
Reply With Quote #12

Quote:
Originally Posted by impossible_cc View Post
oops, my version doesnt work because you need a short timer after player_spawn event (I think so).

I'm not sure, but I think that in Cruze's plugin if someone joins server when warmup is already started, or he dies somehow and then respawns again (for example joins spectator then switchs back to team), he won't be freezed. Tell me if I'm wrong.

Still not tested, sorry if it doesnt work.

PHP Code:

#include <sourcemod> 
#include <sdktools> 

public Plugin myinfo =  

    
name "Warmup Waiting"
    
author "Reid"
    
description "Simple plugin for waiting other player's connecting by restricting movement"
    
version "0.0.1"
    
url "" 
};

public 
void OnMapStart() 
{
    
float GetWarmUpTime = (FindConVar("mp_warmuptime")).FloatValue
    if(
GetWarmUpTime 0.0)
    {
        
HookEvent("player_spawn"OnPlayerSpawnEventHookMode_Post);
        
        
CreateTimer(GetWarmUpTimeWarmUpOver);
    }


public 
void OnPlayerSpawn(Event event, const char[] namebool dontBroadcast
{
    
CreateTimer(0.0PlayerSpawnDelayedevent.GetInt("userid"));


public 
Action PlayerSpawnDelayed(Handle timerint userid)
{
    
int client GetClientOfUserId(userid);
    
    if(
IsClientInGame(client) && IsPlayerAlive(client))
    {
        
SetEntityMoveType(clientMOVETYPE_NONE);  
    }
    
    
PrintCenterText(client"Please wait for other players connect"); 
    
PrintToChat(client"Please wait for other players connect."); 
}

public 
Action WarmUpOver(Handle timer
{
    
UnhookEvent("player_spawn"OnPlayerSpawnEventHookMode_Post);        //We don't need it anymore, so unhook.
    
    
for(int i 1<= MaxClientsi++) 
    { 
        if (
IsClientInGame(i) && IsPlayerAlive(i)) 
        { 
            
SetEntityMoveType(iMOVETYPE_WALK);  
        } 
    }
    
    
PrintCenterTextAll("Game is going to start!"); 
    
PrintToChatAll("Game is going to start!"); 

Sorry for late reply

And yes, Cruze's version has these problems
Thanks for noticing
I tested your final version, it was working more perfectly.

And thank you again, you still keep helping me such friendly
I really learn a lot from your code.
reid123455 is offline
Cruze
Veteran Member
Join Date: May 2017
Old 03-05-2019 , 07:48   Re: Need help for complied errors
Reply With Quote #13

Quote:
Originally Posted by impossible_cc View Post
I'm not sure, but I think that in Cruze's plugin if someone joins server when warmup is already started, or he dies somehow and then respawns again (for example joins spectator then switchs back to team), he won't be freezed. Tell me if I'm wrong.
Yup, nice catch. Wrote that from mobile and didn't think that much
__________________
Taking paid private requests! Contact me
Cruze 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 22:52.


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