Delete the origin line, I don't know how it ended up there... maybe my fault, not sure.
It compiles now, at least.
PHP Code:
public checkpoint(id) {
if(get_pcvar_num(kz_checkpoints) == 1) {
if(is_user_alive(id)) {
new Float:velocity[3]
entity_get_vector(id,EV_VEC_velocity,velocity)
if(entity_get_int(id,EV_INT_flags)&FL_DUCKING) {
client_print(id,print_chat,"[ProKreedz] You can not create a checkpoint while ducking")
return PLUGIN_HANDLED
}
else if(velocity[2]!=0)
{
client_print(id,print_chat,"[ProKreedz] You must be on the ground to create a checkpoint")
return PLUGIN_HANDLED
}
for(new i=MAX_CPS-1;i>0;i--) {
checkpoints[id-1][i][0] = checkpoints[id-1][i-1][0]
checkpoints[id-1][i][1] = checkpoints[id-1][i-1][1]
checkpoints[id-1][i][2] = checkpoints[id-1][i-1][2]
}
new Float:origin[3]
entity_get_vector(id,EV_VEC_origin,origin)
checkpoints[id-1][0][0] = origin[0]
checkpoints[id-1][0][1] = origin[1]
checkpoints[id-1][0][2] = origin[2]
if(checkpointnum[id-1] > 0)
client_print(id,print_chat,"[ProKreedz] Checkpoint no. %d created, distance to the previous one: %dm",checkpointnum[id-1]+1,floatround(get_distance_f(checkpoints[id-1][1],origin) / 20,floatround_round))
else
client_print(id,print_chat,"[ProKreedz] First checkpoint created")
checkpointnum[id-1]++
}
else
client_print(id,print_chat,"[ProKreedz] You have to be alive to use this function")
}
else
client_print(id,print_chat,"[ProKreedz] Checkpoints are disabled")
return PLUGIN_HANDLED
}
__________________