Raised This Month: $51 Target: $400
 12% 

checkpoint and teleport+


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lopol2010
Junior Member
Join Date: Aug 2015
Location: Russia
Old 08-23-2015 , 14:33   checkpoint and teleport+
Reply With Quote #1

checkpoint saving speed, position and camera direction
teleport return saved speed, pos, cam direct

can you make this please

Last edited by Lopol2010; 08-23-2015 at 14:33.
Lopol2010 is offline
Keys PK
Member
Join Date: Mar 2015
Location: Romania
Old 08-23-2015 , 17:31   Re: checkpoint and teleport+
Reply With Quote #2

try
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

new const
    
PLUGIN_NAME    [] = "Checkpoints & Teleport",
    
PLUGIN_VERSION    [] = "1.0",
    
PLUGIN_AUTHOR    [] = "Keys"

new bool:g_bHasCheckpoint[33];

new 
Float:g_bCheckpointOrigin[33][3];
new 
Float:g_bCheckpointAngle[33][3];
new 
Float:g_bCheckpointGravity[33][3];

new const 
Float:VEC_DUCK_HULL_MIN[3] = {-16.0, -16.0, -18.0}
new const 
Float:VEC_DUCK_HULL_MAX[3] = {16.016.032.0}
new const 
Float:VEC_DUCK_VIEW[3] = {0.00.012.0}
new const 
Float:VEC_NULL[3] = {0.00.00.0}

public 
plugin_init() {
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
    
    
register_clcmd("say /teleport""gocheckpoint");
    
register_clcmd("say /checkpoints""checkpoint_menu");
    
register_clcmd("say /cp","checkpoint_menu");
}
public 
client_connect(id) {
    
g_bHasCheckpoint[id] = false;
}

public 
checkpoint_menu(id){
    
    new 
menu menu_create("Checkpoint Menu""menu_handler");
    
    
menu_additem(menu"Save Checkpoint"""0);
    
menu_additem(menu"Delete Checkpoint"""0);
    
menu_additem(menu"Teleport"""0);
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
    
    return 
PLUGIN_HANDLED;
}
public 
menu_handler(idmenuitem){
    
    if(
item == MENU_EXIT)
    {
        
menu_cancel(id);
        return 
PLUGIN_HANDLED;
    }
    
    new 
command[6], name[64], accesscallback;
    
    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);
    
    switch(
item)
    {
        case 
0:SaveCheckpoint(id)
        case 
1:RemoveCheckpoint(id)
        case 
2:fwTeleport(id)
    }
    
menu_display(idmenu0);
    return 
PLUGIN_HANDLED;
}


public 
fwTeleport(id){
    
    if (!
is_user_connected(id) || cs_get_user_team(id) == CS_TEAM_SPECTATOR)         return;
    
ExecuteHamB(Ham_CS_RoundRespawnid)
    
    if(
g_bHasCheckpoint[id] == true) {
        
LoadCheckpoint(id);
    }
}
public 
gocheckpoint(id){
    
    if(
is_user_alive(id)){
        
fwTeleport(id);
    }
    return 
PLUGIN_HANDLED;
}

public 
SaveCheckpoint(id){
    
    if ( !
is_user_alive(id) ) 
    {
        
client_print(idprint_chat"You have to be alive to save the checkpoint.");
        return 
PLUGIN_HANDLED;
    }
    
    
pev(idpev_origing_bCheckpointOrigin[id])
    
pev(idpev_v_angleg_bCheckpointAngle[id])
    
pev(idpev_gravityg_bCheckpointGravity[id][2])

    
client_print(idprint_chat"Checkpoint saved!");
    
    if ( !
g_bHasCheckpoint[id] )            g_bHasCheckpoint[id] = true;
    
    return 
PLUGIN_HANDLED;
}
public 
LoadCheckpoint(id) {
    
    if ( !
is_user_alive(id) )
    {
        
client_print(idprint_chat"You have to be alive if you want to teleport.");
        return 
PLUGIN_HANDLED;
    }
    
set_checkpoint(idg_bCheckpointOrigin[id], g_bCheckpointAngle[id])
    
    return 
PLUGIN_HANDLED;
}
public 
RemoveCheckpoint(id)
{
    
g_bHasCheckpoint[id] = false;
    
client_print(idprint_chat"Checkpoint removed!")
}

set_checkpoint(idFloat:flOrigin[3], Float:flAngles[3]) {
    
    new 
iFlags pev(idpev_flags)
    
iFlags &= ~FL_BASEVELOCITY
    iFlags 
|= FL_DUCKING
    set_pev
(idpev_flagsiFlags)
    
engfunc(EngFunc_SetSizeidVEC_DUCK_HULL_MINVEC_DUCK_HULL_MAX)
    
engfunc(EngFunc_SetOriginidflOrigin)
    
set_pev(idpev_view_ofsVEC_DUCK_VIEW)
    
    
set_pev(idpev_v_angleVEC_NULL)
    
set_pev(idpev_velocityVEC_NULL)
    
set_pev(idpev_basevelocityVEC_NULL)
    
set_pev(idpev_anglesflAngles)
    
set_pev(idpev_punchangleVEC_NULL)
    
set_pev(idpev_fixangle1)
    
    
set_pev(idpev_gravityflAngles[2])
    
    
set_pev(idpev_fuser20.0)

__________________

Last edited by Keys PK; 08-23-2015 at 17:38. Reason: update
Keys PK is offline
Send a message via Skype™ to Keys PK
Lopol2010
Junior Member
Join Date: Aug 2015
Location: Russia
Old 08-26-2015 , 07:26   Re: checkpoint and teleport+
Reply With Quote #3

Quote:
Originally Posted by Keys PK View Post
nice, but speed dont saving. Save only pos and cam. dir.
can you add speed saving?

sorry for my english

Last edited by Lopol2010; 08-26-2015 at 07:50.
Lopol2010 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:22.


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