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 touched1( ent, id )
{
for( new i=0; i < cp_count; i++ )//probably this is wrong, but what better to use ? :/
{
entity_get_string(ent, EV_SZ_targetname, targetName, charsmax(targetName));
if( containi( targetName, cp_ents[i] ))
{
if( !run_run[i+1] )
{
run_run[i+1]=true
Time_igrac = get_gametime() - cp_time[id][i]
client_print( id, print_chat, "You touched: %i; time: %.02f (FILE: %.02f)", i+1, Time_igrac, official_time[1][cp_count+1] )
}
}
//break;
}
}