AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   save position before drop (https://forums.alliedmods.net/showthread.php?t=237573)

elantra86 03-26-2014 13:45

save position before drop
 
hi all
how to auto save position before client dropped with reason adsl fault ?

Code:

reason: reliable channel overflowed
or
Code:

reason: client sent drop
it's important for kz mode ) to continue saved game.)

here part of code:
PHP Code:

public SavePos(id)
{

    new 
authid[33];
    
get_user_authid(idauthid32)
    if(
get_pcvar_num(kz_save_pos) == 0)
    {
        
kz_chat(id"%L"id"KZ_SAVEPOS_DISABLED")
        return 
PLUGIN_HANDLED
    
}

    if(
equal(authid"VALVE_ID_LAN") || equal(authid"STEAM_ID_LAN") || strlen(authid) > 18)
    {
        
ColorChat (idGREEN"%s^x01 %L"prefixid"KZ_NO_STEAM")
        
        return 
PLUGIN_HANDLED
    
}    
        
    if( !( 
pevidpev_flags ) & FL_ONGROUND2  ) )
    {
        
kz_chat(id"%L"id"KZ_NOT_ON_GROUND")
        
        return 
PLUGIN_HANDLED
    
}
    
    if(!
timer_started[id])
    {
        
kz_chat(id"%L"id"KZ_TIMER_NOT_STARTED")
        return 
PLUGIN_HANDLED
    
}
    
    if(
Verif(id,1))
    {
        
ColorChat(idGREEN,  "%s^x01 %L"prefixid"KZ_SAVEPOS_ALREADY")
        
savepos_menu(id)
        return 
PLUGIN_HANDLED
    
}
    
    if(
get_user_noclip(id))
    {
        
ColorChat(idGREEN"%s^x01 %L"prefixid"KZ_SAVEPOS_NOCLIP")
        return 
PLUGIN_HANDLED
    
}
    
    new 
Float:origin[3], scout
    pev
(idpev_originorigin)
    new 
Float:Time,check,gocheck 
    
if(IsPaused[id])
    {
        
Time g_pausetime[id]
        
Pause(id)
    }
    else
        
Time=get_gametime() - timer_time[id]
    
check=checknumbers[id]
    
gocheck=gochecknumbers[id]
    
ColorChat(idGREEN,  "%s^x01 %L"prefixid"KZ_SAVEPOS")
    if (
user_has_scout[id])
        
scout=1
    
else
        
scout=0
    kz_savepos
(idTimecheckgocheckoriginscout)
    
reset_checkpoints(id)
    
    return 
PLUGIN_HANDLED


sorry for my eng. thx in advance

elantra86 03-26-2014 14:54

Re: save position before drop
 
Running non-steam server
i think is not important how runned server (non-steam or steam)
because i comment this code & if i save position handle i can continue after reconnect(my pos saved)

// if(
equal(authid, "VALVE_ID_LAN") || equal(authid, "STEAM_ID_LAN") || strlen(authid) > 18)
// {
//
ColorChat (id, GREEN, "%s^x01 %L", prefix, id, "KZ_NO_STEAM")
//
// return
PLUGIN_HANDLED
//
}

Black Rose 03-26-2014 16:36

Re: save position before drop
 
The code posted just prints an error message and returns once it hits VALVE_ID_LAN or STEAM_ID_LAN.
It is to prevent non-steam. So the code is completely legit.
The thread author answered that without any valid suspicion.
Hilarious.

elantra86 03-27-2014 00:04

Re: save position before drop
 
Quote:

Originally Posted by Black Rose (Post 2116286)
The code posted just prints an error message and returns once it hits VALVE_ID_LAN or STEAM_ID_LAN.
It is to prevent non-steam. So the code is completely legit.
The thread author answered that without any valid suspicion.
Hilarious.

i know )
but it works for me.
It's possible or not?
(save pos before quiting or drop)

Black Rose 03-27-2014 14:08

Re: save position before drop
 
It's too late now that you have admitted to using non-steam.

@WildCard65 He is violating the rules, there was just no evidence in his first post.

WildCard65 03-27-2014 14:13

Re: save position before drop
 
So we can have a moderator trash this thread?


All times are GMT -4. The time now is 05:58.

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