View Single Post
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 03-03-2019 , 12:20   Re: Need help for complied errors
Reply With Quote #6

I did not test it, but it should work.

I changed your logic actually, I'm sorry if it is a bit difficult for you.
Also I prefer new syntax, it is more familiar to me, because it is closer to 'C' syntax
Feel free to ask questions


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() 

    
//new GetWarmUpTime = GetConVarInt(FindConVar("mp_warmuptime")); 
    //CreateTimer(GetWarmUpTime*1.0,WarmUpOver); //let GetWarmUpTime be float and set WarmUpOver callback 
    
    
float GetWarmUpTime = (FindConVar("mp_warmuptime")).FloatValue
    if(
GetWarmUpTime 0.0)
    {
        
HookEvent("player_spawn"OnPlayerSpawnEventHookMode_Post);
        
        
CreateTimer(GetWarmUpTime,WarmUpOver);
    }


public 
void OnPlayerSpawn(Event event, const char[] namebool dontBroadcast
{
    
int client GetClientOfUserId(event.GetInt("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-03-2019 at 12:23.
impossible_cc is offline