AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Change players max. Speed + teleport (https://forums.alliedmods.net/showthread.php?t=87052)

One 03-06-2009 03:05

Change players max. Speed + teleport
 
Hi,

how to change max. speed of only one player? i mean change the max speed for special race?

PHP Code:

        case 0:  
        { 
            
fm_strip_user_weapons(id);
            
fm_give_item(id"weapon_knife");
            
fm_give_item(id"weapon_m4a1");
            
fm_give_item(id"ammo_556nato");
            
fm_give_item(id"ammo_556nato");
            
fm_give_item(id"ammo_556nato");
            
fm_give_item(id"weapon_hegrenade");
            
fm_give_item(id"weapon_glock18");

            
fm_set_user_health(idget_pcvar_num(RifflemanHP));
            
fm_set_user_armor(idget_pcvar_num(RifllemanAR));
            
fm_set_rendering(idkRenderFxGlowShell01000kRenderNormal170);
    

        } 

& how can i give this race an teleport like the teleport on WC3... i tried to copy anything from WC3 but its to high 4 me :mrgreen:

i have 5 races & its willbe nice when anyone has any idea 4 the races. ( name will be posted in release TH. )

GoGoGo 03-06-2009 05:01

Re: Change players max. Speed + teleport
 
Set user origin && get user origin.

http://www.amxmodx.org/funcwiki.php?...igin&go=search

set user maxspeed

http://www.amxmodx.org/funcwiki.php?...peed&go=search

One 03-06-2009 05:42

Re: Change players max. Speed + teleport
 
Quote:

Originally Posted by GoGoGo (Post 775007)

ty,

1. what is here wrong ?

PHP Code:

new Float:speed get_user_maxspeed(id) + 85.0

case 
1:
        {
            
fm_strip_user_weapons(id);
            
fm_give_item(id"weapon_knife");
            
fm_give_item(id"weapon_galil");
            
fm_give_item(id"ammo_556nato");
            
fm_give_item(id"ammo_556nato"); 
            
fm_give_item(id"ammo_556nato");
            
fm_give_item(id"weapon_smokegrenade");
            
fm_give_item(id"weapon_hegrenade");
            
fm_give_item(id"weapon_usp");
            
fm_give_item(id"ammo_45acp");
            
fm_give_item(id"ammo_45acp");
            
fm_give_item(id"ammo_45acp");
            
fm_give_item(id"ammo_45acp");
            
fm_give_item(id"ammo_45acp");
            
fm_give_item(id"ammo_45acp");
            
fm_give_item(id"ammo_45acp");
            
fm_give_item(id"ammo_45acp");
            
set_user_maxspeed(id speed); 
            
    
            
fm_set_user_health(idget_pcvar_num(DOD_AssaultHP));
            
fm_set_user_armor(idget_pcvar_num(DOD_AssaultAR));
            
fm_set_rendering(idkRenderFxGlowShell02550kRenderNormal170);
        
        } 

ERROR :
PHP Code:

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2006 ITB CompuPhaseAMX Mod X Team

Error
Undefined symbol "set_user_maxspeed" on line 488
Warning
Symbol is never used"speed" on line 704

1 Error
.
Could not locate output file C:\Dokumente und Einstellungen\One\Desktop\DOD_CharactersMod.amx (compile failed). 

iknow i have to register speed. but how?


2. i need an example for the teleport :-( & how can user bind a key to use this? like WC3 : bind key ultimate

xPaw 03-06-2009 06:04

Re: Change players max. Speed + teleport
 
PHP Code:

#include <fakemeta_util>

fm_set_user_maxspeedid265.0 ); 

also hook curweapon and change speed there if player have that race.... because after change weapon his speed resets.

One 03-06-2009 06:12

Re: Change players max. Speed + teleport
 
Quote:

Originally Posted by xPaw (Post 775022)
PHP Code:

#include <fakemeta_util>

fm_set_user_maxspeedid265.0 ); 

also hook curweapon and change speed there if player have that race.... because after change weapon his speed resets.

Ma hero :mrgreen:

ok, its right now? by case 1 :

PHP Code:

switch(keys
    {
        case 
0:  
        { 
            
fm_strip_user_weapons(id);
            
fm_give_item(id"weapon_knife");
            
fm_give_item(id"weapon_m4a1");
            
fm_give_item(id"ammo_556nato");
            
fm_give_item(id"ammo_556nato");
            
fm_give_item(id"ammo_556nato");
            
fm_give_item(id"weapon_hegrenade");
            
fm_give_item(id"weapon_glock18");

            
fm_set_user_health(idget_pcvar_num(DOD_RifflemanHP));
            
fm_set_user_armor(idget_pcvar_num(DOD_RifllemanAR));
            
fm_set_rendering(idkRenderFxGlowShell01000kRenderNormal170);
    
        }
        case 
1:
        {
            
fm_strip_user_weapons(id);
            
fm_give_item(id"weapon_knife");
            
fm_give_item(id"weapon_galil");
            
fm_give_item(id"ammo_556nato");
            
fm_give_item(id"ammo_556nato"); 
            
fm_give_item(id"ammo_556nato");
            
fm_give_item(id"weapon_smokegrenade");
            
fm_give_item(id"weapon_hegrenade");
            
fm_give_item(id"weapon_usp");
            
fm_give_item(id"ammo_45acp");
            
fm_give_item(id"ammo_45acp");
            
fm_give_item(id"ammo_45acp");
            
fm_give_item(id"ammo_45acp");
            
fm_give_item(id"ammo_45acp");
            
fm_give_item(id"ammo_45acp");
            
fm_give_item(id"ammo_45acp");
            
fm_give_item(id"ammo_45acp");
            
fm_set_user_maxspeedid265.0 );  
    
            
fm_set_user_health(idget_pcvar_num(DOD_AssaultHP));
            
fm_set_user_armor(idget_pcvar_num(DOD_AssaultAR));
            
fm_set_rendering(idkRenderFxGlowShell02550kRenderNormal170);
        
        } 


xPaw 03-06-2009 07:01

Re: Change players max. Speed + teleport
 
should be, but read my post again, wich i posted before.

BOYSplayCS 03-06-2009 07:10

Re: Change players max. Speed + teleport
 
Pawn needs a repeat function.

Something like:
PHP Code:

public repeating_example(id)
{
    case 
1:
    {
        
fm_strip_user_weapons(id);
        
fm_give_item(id"weapon_knife");
        
fm_give_item(id"weapon_galil");
        
fm_give_item(id"ammo_556nato");
        
fm_give_item(id"ammo_556nato"); 
        
fm_give_item(id"ammo_556nato");
        
fm_give_item(id"weapon_smokegrenade");
        
fm_give_item(id"weapon_hegrenade");
        
fm_give_item(id"weapon_usp");
        
        
repeat_command(8)
        
fm_give_item(id"ammo_45acp");
        
repeat_command(0)
        
        
fm_set_user_maxspeedid265.0 );  
        
        
fm_set_user_health(idget_pcvar_num(DOD_AssaultHP));
        
fm_set_user_armor(idget_pcvar_num(DOD_AssaultAR));
        
fm_set_rendering(idkRenderFxGlowShell02550kRenderNormal170);
    }


It would be easier cause you'd be able to repeat that command eight times and then move on with the script.

One 03-06-2009 07:18

Re: Change players max. Speed + teleport
 
Quote:

Originally Posted by BOYSplayCS (Post 775059)
Pawn needs a repeat function.

Something like:
PHP Code:

public repeating_example(id)
{
    case 
1:
    {
        
fm_strip_user_weapons(id);
        
fm_give_item(id"weapon_knife");
        
fm_give_item(id"weapon_galil");
        
fm_give_item(id"ammo_556nato");
        
fm_give_item(id"ammo_556nato"); 
        
fm_give_item(id"ammo_556nato");
        
fm_give_item(id"weapon_smokegrenade");
        
fm_give_item(id"weapon_hegrenade");
        
fm_give_item(id"weapon_usp");
        
        
repeat_command(8)
        
fm_give_item(id"ammo_45acp");
        
repeat_command(0)
        
        
fm_set_user_maxspeedid265.0 );  
        
        
fm_set_user_health(idget_pcvar_num(DOD_AssaultHP));
        
fm_set_user_armor(idget_pcvar_num(DOD_AssaultAR));
        
fm_set_rendering(idkRenderFxGlowShell02550kRenderNormal170);
    }


It would be easier cause you'd be able to repeat that command eight times and then move on with the script.

Oh ty,

i have it changed & must wait to test when im @ home.

how about the teleport? any idea?

EDIT :
PHP Code:

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2006 ITB CompuPhaseAMX Mod X Team

Error
Undefined symbol "repeat_command" on line 476
Error
Undefined symbol "repeat_command" on line 478
Error
Undefined symbol "repeat_command" on line 496
Error
Undefined symbol "repeat_command" on line 498
Error
Undefined symbol "repeat_command" on line 512
Error
Undefined symbol "repeat_command" on line 514
Error
Undefined symbol "repeat_command" on line 516
Error
Undefined symbol "repeat_command" on line 518
Error
Undefined symbol "repeat_command" on line 519
Error
Undefined symbol "repeat_command" on line 521
Error
Undefined symbol "repeat_command" on line 534
Error
Undefined symbol "repeat_command" on line 536
Error
Undefined symbol "repeat_command" on line 538
Error
Undefined symbol "repeat_command" on line 540

14 Errors
.
Could not locate output file C:\Dokumente und Einstellungen\One\Desktop\DOD_CharactersMod.amx (compile failed). 

here ma code :

PHP Code:

case 0:  
        { 
            
fm_strip_user_weapons(id);
            
fm_give_item(id"weapon_knife");
            
fm_give_item(id"weapon_m4a1");
            
fm_give_item(id"ammo_556nato");
            
fm_give_item(id"ammo_556nato");
            
fm_give_item(id"ammo_556nato");
            
fm_give_item(id"weapon_hegrenade");
            
fm_give_item(id"weapon_glock18");

            
fm_set_user_health(idget_pcvar_num(DOD_RifflemanHP));
            
fm_set_user_armor(idget_pcvar_num(DOD_RifllemanAR));
            
fm_set_rendering(idkRenderFxGlowShell01000kRenderNormal170);
    
        }
        case 
1:
        {
            
fm_strip_user_weapons(id);
            
fm_give_item(id"weapon_knife");
            
fm_give_item(id"weapon_galil");
            
fm_give_item(id"ammo_556nato");
            
fm_give_item(id"ammo_556nato"); 
            
fm_give_item(id"ammo_556nato");
            
fm_give_item(id"weapon_smokegrenade");
            
fm_give_item(id"weapon_hegrenade");
            
repeat_command(8)
            
fm_give_item(id"ammo_45acp");
            
repeat_command(0)
            
fm_set_user_maxspeedid265.0 );  
    
            
fm_set_user_health(idget_pcvar_num(DOD_AssaultHP));
            
fm_set_user_armor(idget_pcvar_num(DOD_AssaultAR));
            
fm_set_rendering(idkRenderFxGlowShell02550kRenderNormal170);
        
        }
        case 
2:
        {
            
fm_strip_user_weapons(id);
            
fm_give_item(id"weapon_knife");
            
fm_give_item(id"weapon_ak47");
            
fm_give_item(id"ammo_762nato");
            
fm_give_item(id"ammo_762nato");
            
fm_give_item(id"ammo_762nato");
            
fm_give_item(id"weapon_hegrenade");
            
fm_give_item(id"weapon_fiveseven");
            
repeat_command(4)
            
fm_give_item(id"ammo_57mm");
            
repeat_command(0)
            
            
            
fm_set_user_health(idget_pcvar_num(DOD_SuportHP));
            
fm_set_user_armor(idget_pcvar_num(DOD_SuportAR));
            
fm_set_rendering(idkRenderFxGlowShell1242520kRenderNormal170);
            
        }
        case 
3:
        {
            
            
fm_strip_user_weapons(id);
            
fm_give_item(id"weapon_knife");
            
fm_give_item(id"weapon_awp");
            
repeat_command(3)
            
fm_give_item(id"ammo_338magnum");
            
repeat_command(0)
            
fm_give_item(id"weapon_deagle");
            
repeat_command(7)
            
fm_give_item(id"ammo_50ae");
            
repeat_command(0)
            
repeat_command(2)
            
fm_give_item(id"weapon_flashbang");    
            
repeat_command(0)
            
            
fm_set_user_health(idget_pcvar_num(DOD_SniperHP));
            
fm_set_user_armor(idget_pcvar_num(DOD_SniperAR));
            
fm_set_rendering(idkRenderFxGlowShell691390kRenderNormal170);
            
        }
        case 
4:
        {
            
            
fm_strip_user_weapons(id);
            
fm_give_item(id"weapon_knife");
            
fm_give_item(id"weapon_m249");
            
repeat_command(7)
            
fm_give_item(id"ammo_556natobox");
            
repeat_command(0)
            
fm_give_item(id"weapon_p228");
            
repeat_command(6)
            
fm_give_item(id"ammo_357sig");
            
repeat_command(0)

            
fm_set_user_health(idget_pcvar_num(DOD_MachineGunnerHP));
            
fm_set_user_armor(idget_pcvar_num(DOD_MachineGunnerAR));
            
fm_set_rendering(idkRenderFxGlowShell0255127kRenderNormal170);
            
        } 


GoGoGo 03-06-2009 07:21

Re: Change players max. Speed + teleport
 
BOY you forget about swich(),

One show whole code, not just a part

Look at: http://forums.alliedmods.net/showthr...ght=origin+set

There is a funcion to make CP and Go to CP (with get and set origin).

First you save origin by get user origin, than you teleport by set user origin.

One 03-06-2009 07:48

Re: Change players max. Speed + teleport
 
Quote:

Originally Posted by GoGoGo (Post 775065)
BOY you forget about swich(),

One show whole code, not just a part

Look at: http://forums.alliedmods.net/showthr...ght=origin+set

There is a funcion to make CP and Go to CP (with get and set origin).

First you save origin by get user origin, than you teleport by set user origin.

ty, but i cant understand what there means! :cry::cry::cry:

how i understood this TH, its checkpoint & not Position from eyes (weapon aiming) :cry:
can i pm u & send all ma code?

EDIT : how hook an weapon/weapons?


All times are GMT -4. The time now is 16:52.

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