View Single Post
Author Message
JocAnis
Veteran Member
Join Date: Jun 2010
Old 06-21-2018 , 07:14   Touch positions problem
Reply With Quote #1

im trying to make plugin with checkpoints per map, saved in .ini file ect...but i need help, how to determine what exactly position/checkpoint (model) has player touched ? I mean, the present code is working: if players touches first checkpoint he will get printed message for ALL these checkpoints on the map, which is the problem...here is the code...i dont have idea how to code that thing :s

PHP Code:
register_touch("cp_ent""player""touched1"

...
making entity cp_ent...

public 
touched1entid )
{
    for( new 
i=0cp_counti++ )//probably this is wrong, but what better to use ? :/
    
{
        
entity_get_string(entEV_SZ_targetnametargetNamecharsmax(targetName));
        if( 
containitargetNamecp_ents[i] ))
        {
            if( !
run_run[i+1] )
            {
                
run_run[i+1]=true
                Time_igrac 
get_gametime() - cp_time[id][i]
                
                
client_printidprint_chat"You touched: %i; time: %.02f (FILE: %.02f)"i+1Time_igracofficial_time[1][cp_count+1] )

            }
        }
        
//break;
    
}

JocAnis is offline