AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Script corrections: (https://forums.alliedmods.net/showthread.php?t=55172)

kmal2t 05-15-2007 15:44

Script corrections:
 
brawrr

regalis 05-15-2007 16:51

Re: Script corrections:
 
For problem 1 i have a solution...

Code:

public event_Touch(pTouched, pToucher)
{
    new classTouched[32];
    new classToucher[32];
   
    // Get the Classname from the touched entity and the toucher
    pev(pTouched, pev_classname, classTouched, 31);
    pev(pToucher, pev_classname, classToucher, 31);
   
   
    // Check if Touched is a blubbb and the Toucher is alive
    if(!is_user_alive(pToucher)) return PLUGIN_CONTINUE;   
    if(!equal(classTouched, "func_breakable")) return PLUGIN_CONTINUE; // here you check what classname the touched have

    // A Player has touched a func_breakable
    // do something
   
    return PLUGIN_CONTINUE;
}

Problem 2 : no idea..0o

And Problem 3: is there a question? (your code seems to work)

pRED* 05-15-2007 17:09

Re: Script corrections:
 
Code:
public bhop(id, level, cid) {     /*turning plugin on or off */     new cmd[32]     read_argv(1, cmd, 31)     remove_quotes(cmd)     if(equali(cmd, "pass1") ) {     /* if they don't have amx_12345 "pass1" its off */         bhopon = true;             }     else {         bhopon = false;         } }

Should fix 3..
You were reading argv 0 (the original command). Argv 1 is the first additional parameter (the password in your case)

And I think I've partially got number 2. Not really sure if this stock is the easiest way to go. Will think about it later

Code:
public SetJumpDistance(id) {         new Float:JumpDistance = tuna formula         new Float:fOrigin[3],Float:fSpeed,Float:fvelocity[3]         pev(id,pev_speed,fSpeed)     //Fine the origin of a poiny JumpDistance away from you (umm.. forgotten..)     velocity_to_point(id, fOrigin, fSpeed, fVelocity)     set_pev(id,pev_velocity,fVelocity) }   /* p34nut's stock */ stock velocity_to_point(id, Float:fOrigin[3], Float:fSpeed, Float:fVelocity[3]) {         if (!is_user_connected(id))         return 0;       static Float:fUserOrigin[3], Float:fDist;         pev(id, pev_origin, fUserOrigin);           fDist = vector_distance(fOrigin, fUserOrigin);       fVelocity[0] = (fOrigin[0] - fUserOrigin[0]) * (2.0 * fSpeed) / fDist;     fVelocity[1] = (fOrigin[1] - fUserOrigin[1]) * (2.0 * fSpeed) / fDist;     fVelocity[2] = (fOrigin[2] - fUserOrigin[2]) * (2.0 * fSpeed) / fDist;     return 1; }


All times are GMT -4. The time now is 10:30.

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