AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   need help get (https://forums.alliedmods.net/showthread.php?t=24394)

Zaser 02-21-2006 04:07

need help get
 
i get this error


// D:\scripting\carmod.sma(448) : error 021: symbol already defined: "client_Pre
Think"
//
// 1 Error.
// Could not locate output file D:\scripting\compiled\carmod.amx (compile failed
).
//
// Compilation Time: 1,3 sec
// ----------------------------------------




Code:

public client_PreThink(id)
    {
    if(incar[id] != 0)
        {
        new bufferstop = entity_get_int(id,EV_INT_button)
       
        if(bufferstop != 0) {
            entity_set_int(id,EV_INT_button,bufferstop & ~IN_ATTACK & ~IN_ATTACK2 & ~IN_ALT1 & ~IN_USE)
        }
       
        if((bufferstop & IN_JUMP) && (entity_get_int(id,EV_INT_flags) & ~FL_ONGROUND & ~FL_DUCKING)) {
            entity_set_int(id,EV_INT_button,entity_get_int(id,EV_INT_button) & ~IN_JUMP)
        }
        return PLUGIN_CONTINUE
    }
    return PLUGIN_HANDLED
}
----------


public client_PreThink(id) {
 
    if(incar[id])
    {
        new Float:VecVel[3],Float:VecAngles[3];
        entity_get_vector(id,EV_VEC_velocity,VecVel);
        entity_get_vector(id,EV_VEC_v_angle,VecAngles);

        VecVel[0] = floatcos(VecAngles[1],degrees) * 800.0;
        VecVel[1] = floatsin(VecAngles[1],degrees) * 800.0;

        entity_set_vector(id,EV_VEC_velocity,VecVel);
   
  }
    return PLUGIN_HANDLED
}

how can i fix this?

teame06 02-21-2006 04:11

Code:
public client_PreThink(id) {     if(incar[id] != 0)     {         new bufferstop = entity_get_int(id,EV_INT_button)                   if(bufferstop != 0) {             entity_set_int(id,EV_INT_button,bufferstop & ~IN_ATTACK & ~IN_ATTACK2 & ~IN_ALT1 & ~IN_USE)         }                   if((bufferstop & IN_JUMP) && (entity_get_int(id,EV_INT_flags) & ~FL_ONGROUND & ~FL_DUCKING)) {             entity_set_int(id,EV_INT_button,entity_get_int(id,EV_INT_button) & ~IN_JUMP)         }     }         if(incar[id])     {         new Float:VecVel[3],Float:VecAngles[3];         entity_get_vector(id,EV_VEC_velocity,VecVel);         entity_get_vector(id,EV_VEC_v_angle,VecAngles);         VecVel[0] = floatcos(VecAngles[1],degrees) * 800.0;         VecVel[1] = floatsin(VecAngles[1],degrees) * 800.0;         entity_set_vector(id,EV_VEC_velocity,VecVel);     } }

And you got hit by the OLO ulgy code structure ^_^

PS. You can't do that twice public Client_Prethink and public Client_PreThink twice like that

Charr 02-21-2006 08:02

This would work too
Code:
 public client_PreThink(id) {     if(incar[id])     {         new bufferstop = entity_get_int(id,EV_INT_button)                   if(bufferstop != 0) {             entity_set_int(id,EV_INT_button,bufferstop & ~IN_ATTACK & ~IN_ATTACK2 & ~IN_ALT1 & ~IN_USE & ~IN_ALT2 & ~IN_JUMP)         }         new Float:VecVel[3],Float:VecAngles[3];         entity_get_vector(id,EV_VEC_velocity,VecVel);         entity_get_vector(id,EV_VEC_v_angle,VecAngles);         VecVel[0] = floatcos(VecAngles[1],degrees) * 800.0;         VecVel[1] = floatsin(VecAngles[1],degrees) * 800.0;         entity_set_vector(id,EV_VEC_velocity,VecVel);     } }

If you move too slow for the carmod, increase the 800.0.

ng1200 02-21-2006 08:03

Quote:

Originally Posted by Charr
This would work too
Code:
 public client_PreThink(id) {     if(incar[id])     {         new bufferstop = entity_get_int(id,EV_INT_button)                   if(bufferstop != 0) {             entity_set_int(id,EV_INT_button,bufferstop & ~IN_ATTACK & ~IN_ATTACK2 & ~IN_ALT1 & ~IN_USE & ~IN_ALT2 & ~IN_JUMP)         }         new Float:VecVel[3],Float:VecAngles[3];         entity_get_vector(id,EV_VEC_velocity,VecVel);         entity_get_vector(id,EV_VEC_v_angle,VecAngles);         VecVel[0] = floatcos(VecAngles[1],degrees) * 800.0;         VecVel[1] = floatsin(VecAngles[1],degrees) * 800.0;         entity_set_vector(id,EV_VEC_velocity,VecVel);     } }

If you move too slow for the carmod, increase the 800.0.

the problem with this code is that u cant stop.

Charr 02-21-2006 08:06

I used the same code for other reasons, and you should be able to slow down. What else does the code do?

Zaser 02-23-2006 08:28

boys is there any one i can pm my script to becuse now it drive all the time it cant be stoped and i just want it to run when you press walk keys


All times are GMT -4. The time now is 20:18.

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