Raised This Month: $ Target: $400
 0% 

Problem with compilation


Post New Thread Reply   
 
Thread Tools Display Modes
misiakool12
Member
Join Date: Apr 2016
Old 01-18-2018 , 02:17   Re: Problem with compilation
Reply With Quote #11

I'm sorry, but I'm having trouble connecting to the internet yet. I am currently writing from a telephone. After fixing the fault by my internet provider, I will provide the code and errors.
misiakool12 is offline
misiakool12
Member
Join Date: Apr 2016
Old 01-18-2018 , 09:19   Re: Problem with compilation
Reply With Quote #12

As I wrote, changed and still errors.


PHP Code:
public Action:Prethink(client)
{
    if(!
IsValidClient(client) || IsFakeClient(client) || freeze_time)
        return 
Plugin_Continue;

    if(
IsPlayerAlive(client))
    {
        new 
buttons GetClientButtons(client);
        new 
ile poziom_gracza[client]->= 0doswiadczenie_poziomu[poziom_gracza[client]-1]: 0;
        new 
Float:procent_gracza 0.0;
        
procent_gracza = (float(doswiadczenie_gracza[client]-ile)/float(doswiadczenie_poziomu[poziom_gracza[client]]-ile))*100.0;
        
PrintHintText(client"<font size='16'><font color='#006699'>[Klasa: <b>%s</b>]</font>\n<font color='#666699'>[Prędkość:</font> <b>%.1f</b>]\n<font color='#666699'>\n[Xp: <b>%0.1f</b>/<b>100.0%%</b><font color='#666699'> | Lv: <b>%i</b>]\n<font color='#666699'>[Item: <b>%s</b> [<b>%i%%</b>]</font>]"nazwy_klas[klasa_gracza[client]],GetPlayerSpeed(client), procent_graczapoziom_gracza[client], nazwy_itemow[informacje_itemu_gracza[client][0]], moc_itemu[client]);

        new 
String:weapon[32];
        
GetClientWeapon(clientweaponsizeof(weapon));
        switch(
klasa_gracza[client])
        {
            case 
Medyk:
            {
                if(!
oldbuttons1[client] && buttons IN_USE)
                {
                    if(
ilosc_apteczek_gracza[client])
                    {
                        new 
Float:fOrigin[3];
                        new 
Float:iOrigin[3];
                        
GetClientEyePosition(clientFloat:fOrigin);
                        for(new 
1<= MaxClientsi++)
                        {
                            if(!
IsClientInGame(i) || !IsPlayerAlive(i))
                                continue;

                            if(
GetClientTeam(client) != GetClientTeam(i))
                                continue;

                            
GetClientEyePosition(iFloat:iOrigin);
                            if(
GetVectorDistance(fOriginiOrigin) <= 200.0)
                            {
                                new 
heal 40+maksymalna_inteligencja_gracza[client];
                                
SetEntData(iFindDataMapOffs(i"m_iHealth"), GetClientHealth(i)+heal<maksymalne_zdrowie_gracza[i]? GetClientHealth(i)+healmaksymalne_zdrowie_gracza[i]);
                            }
                        }

                        
TE_SetupBeamRingPoint(fOrigin20.0200.0sprite_lasersprite_halo0100.66.00.0, {255255255128}, 100);
                        
TE_SendToAll();
                        
ilosc_apteczek_gracza[client]--;
                    }
                    else
                        
PrintToChat(client"[COD:MW] Wykorzystales juz moc swojej klasy w tej rundzie!");

                    
oldbuttons1[client] = 1;
                }
                else if(
oldbuttons1[client] && !(buttons IN_USE))
                    
oldbuttons1[client] = 0;
            }
            case 
Kangur:
            {
                if(!
oldbuttons2[client] && buttons IN_JUMP)
                {
                    if(
GetGameTime() >= czas_skokow_gracza[client]+1.0)
                    {
                        new 
Float:fOrigin[3];
                        
fOrigin[0] = GetEntDataFloat(clientFindSendPropOffs("CBasePlayer","m_vecVelocity[0]"))*0.8/2.0;
                        
fOrigin[1] = GetEntDataFloat(clientFindSendPropOffs("CBasePlayer","m_vecVelocity[1]"))*0.8/2.0;
                        
fOrigin[2] = 0.8*50.0;
                        
SetEntDataVector(clientFindSendPropOffs("CBasePlayer","m_vecBaseVelocity"), fOrigintrue);
                        
oldbuttons2[client] = 1;
                        
czas_skokow_gracza[client] = RoundFloat(GetGameTime());
                    }
                }
                else if(
oldbuttons2[client] && !(buttons IN_JUMP))
                    
oldbuttons2[client] = 0;
            }
            case 
Szturmen:
            {
                if(!
oldbuttons2[client] && buttons IN_JUMP)
                {
                    new 
flags GetEntityFlags(client);
                    if(!(
flags FL_ONGROUND) && skoki_gracza[client])
                    {
                        new 
Float:fOrigin[3];
                        
GetEntPropVector(clientProp_Data"m_vecVelocity"fOrigin);
                        
fOrigin[2] += 250.0;
                        
TeleportEntity(clientNULL_VECTORNULL_VECTORfOrigin);
                        
skoki_gracza[client] = 0;
                    }
                    else if(
flags FL_ONGROUND)
                        
skoki_gracza[client] = 1;

                    
oldbuttons2[client] = 1;
                }
                else if(
oldbuttons2[client] && !(buttons IN_JUMP))
                    
oldbuttons2[client] = 0;
            }
        }
        switch(
informacje_itemu_gracza[client][0])
        {
            case 
3:
            {
                if(
GetGameTime() >= informacje_itemu_gracza[client][1]+5.0)
                {
                    
SetEntData(clientFindDataMapOffs(client"m_iHealth"), GetClientHealth(client)+10<maksymalne_zdrowie_gracza[client]? GetClientHealth(client)+10maksymalne_zdrowie_gracza[client]);
                    
informacje_itemu_gracza[client][1] = RoundFloat(GetGameTime());
                }
            }
            case 
4:
            {
                if(!
oldbuttons1[client] && buttons IN_USE)
                {
                    if(
informacje_itemu_gracza[client][1])
                    {
                        
SetEntData(clientFindDataMapOffs(client"m_iHealth"), maksymalne_zdrowie_gracza[client]);
                        
informacje_itemu_gracza[client][1] --;
                    }
                    else
                        
PrintToChat(client"[COD:MW] Wykorzystales juz moc swojego itemu w tej rundzie!");

                    
oldbuttons1[client] = 1;
                }
                else if(
oldbuttons1[client] && !(buttons IN_USE))
                    
oldbuttons1[client] = 0;
            }
            case 
13:
            {
                if(!
oldbuttons1[client] && buttons IN_USE)
                {
                    if(
GetEntProp(clientProp_Send"m_bNightVisionOn"))
                        
SetEntProp(clientProp_Send"m_bNightVisionOn"0);
                    else
                        
SetEntProp(clientProp_Send"m_bNightVisionOn"1);

                    
oldbuttons1[client] = 1;
                }
                else if(
oldbuttons1[client] && !(buttons IN_USE))
                    
oldbuttons1[client] = 0;
            }
            case 
19:
            {
                if(!
oldbuttons2[client] && buttons IN_JUMP)
                {
                    new 
flags GetEntityFlags(client);
                    if(!(
flags FL_ONGROUND) && informacje_itemu_gracza[client][1])
                    {
                        new 
Float:fOrigin[3];
                        
GetEntPropVector(clientProp_Data"m_vecVelocity"fOrigin);
                        
fOrigin[2] += 250.0;
                        
TeleportEntity(clientNULL_VECTORNULL_VECTORfOrigin);
                        
informacje_itemu_gracza[client][1] --;
                    }
                    else if(
flags FL_ONGROUND)
                        
informacje_itemu_gracza[client][1] = 1;

                    
oldbuttons2[client] = 1;
                }
                else if(
oldbuttons2[client] && !(buttons IN_JUMP))
                    
oldbuttons2[client] = 0;
            }
            case 
22:
            {
                if(!
oldbuttons1[client] && buttons IN_USE)
                {
                    if(
GetGameTime() >= informacje_itemu_gracza[client][1]+4.0)
                    {
                        new 
Float:velocity[3];
                        new 
Float:velocity0;
                        new 
Float:velocity1;
                        
velocity0 GetEntPropFloat(clientProp_Send"m_vecVelocity[0]");
                        
velocity1 GetEntPropFloat(clientProp_Send"m_vecVelocity[1]");
                        
velocity[0] = (7.0*velocity0)*(1.0/4.1);
                        
velocity[1] = (7.0*velocity1)*(1.0/4.1);
                        
velocity[2] = 0.0;
                        
SetEntPropVector(clientProp_Send"m_vecBaseVelocity"velocity);
                        
informacje_itemu_gracza[client][1] = RoundFloat(GetGameTime());
                    }

                    
oldbuttons1[client] = 1;
                }
                else if(
oldbuttons1[client] && !(buttons IN_USE))
                    
oldbuttons1[client] = 0;
            }
            case 
25:
            {
                if(!
oldbuttons2[client] && buttons IN_ATTACK2)
                {
                    if(!
StrEqual(weaponnazwy_broni[25]) && !StrEqual(weaponnazwy_broni[26]) && !StrEqual(weaponnazwy_broni[27]) && !StrEqual(weaponnazwy_broni[28]) && !StrEqual(weaponnazwy_broni[29]) && !StrEqual(weaponnazwy_broni[30]) && !StrEqual(weaponnazwy_broni[33]) && !StrEqual(weaponnazwy_broni[34]) && !StrEqual(weaponnazwy_broni[35]) && !StrEqual(weaponnazwy_broni[36]) && !StrEqual(weaponnazwy_broni[37]) && !StrEqual(weaponnazwy_broni[38]) && !StrEqual(weaponnazwy_broni[40]) && !StrEqual(weaponnazwy_broni[41]))
                    {
                        if(
informacje_itemu_gracza[client][1])
                        {
                            
informacje_itemu_gracza[client][1] --;
                            
SetEntProp(clientProp_Send"m_iFOV"270);
                        }
                        else
                        {
                            
informacje_itemu_gracza[client][1] = 1;
                            
SetEntProp(clientProp_Send"m_iFOV"90);
                        }
                    }

                    
oldbuttons2[client] = 1;
                }
                else if(
oldbuttons2[client] && !(buttons IN_ATTACK2))
                    
oldbuttons2[client] = 0;
            }
            case 
26:
            {
                if(
GetGameTime() >= informacje_itemu_gracza[client][1]+20.0)
                {
                    
GivePlayerItem(clientnazwy_broni[34]);
                    
informacje_itemu_gracza[client][1] = RoundFloat(GetGameTime());
                }
            }
            case 
31:
            {
                if(
buttons IN_ATTACK)
                    
SetEntData(GetEntPropEnt(clientProp_Send"m_hActiveWeapon"), FindSendPropOffs("CWeaponCSBase""m_iRecoilIndex"), 0);
            }
            case 
34:
            {
                if(!
StrEqual(weaponnazwy_broni[33]) && !StrEqual(weaponnazwy_broni[34]) && !StrEqual(weaponnazwy_broni[35]) && !StrEqual(weaponnazwy_broni[36]) && !StrEqual(weaponnazwy_broni[37]) && !StrEqual(weaponnazwy_broni[38]) && !StrEqual(weaponnazwy_broni[39]) && !StrEqual(weaponnazwy_broni[41]))
                {
                    if(
buttons IN_ATTACK)
                        
SetEntData(GetEntPropEnt(clientProp_Send"m_hActiveWeapon"), FindSendPropOffs("CWeaponCSBase""m_iClip1"), 5);
                }
            }
            case 
35:
            {
                if(!
StrEqual(weaponnazwy_broni[33]) && !StrEqual(weaponnazwy_broni[34]) && !StrEqual(weaponnazwy_broni[35]) && !StrEqual(weaponnazwy_broni[36]) && !StrEqual(weaponnazwy_broni[37]) && !StrEqual(weaponnazwy_broni[38]) && !StrEqual(weaponnazwy_broni[41]))
                {
                    if(
buttons IN_ATTACK)
                    {
                        new 
Float:flNextPrimaryAttack GetEntDataFloat(GetEntPropEnt(clientProp_Send"m_hActiveWeapon"), FindSendPropOffs("CBaseCombatWeapon""m_flNextPrimaryAttack"))-GetGameTime();
                        
SetEntDataFloat(GetEntPropEnt(clientProp_Send"m_hActiveWeapon"), FindSendPropOffs("CBaseCombatWeapon""m_flNextPrimaryAttack"), (flNextPrimaryAttack/1.4)+GetGameTime());
                    }
                }
            }
            case 
38:
            {
                if(!
oldbuttons1[client] && buttons IN_USE)
                {
                    if(
informacje_itemu_gracza[client][1])
                    {
                        new 
Float:fOrigin[3];
                        new 
Float:iOrigin[3];
                        
GetClientEyePosition(clientFloat:fOrigin);
                        for(new 
1<= MaxClientsi++)
                        {
                            if(!
IsClientInGame(i) || !IsPlayerAlive(i))
                                continue;

                            if(
GetClientTeam(client) == GetClientTeam(i))
                                continue;

                            if(
informacje_itemu_gracza[i][0] == 29)
                                continue;

                            
GetClientEyePosition(iFloat:iOrigin);
                            if(
GetVectorDistance(fOriginiOrigin) <= 200.0)
                                
IgniteEntity(i15.0);
                        }

                        
TE_SetupBeamRingPoint(fOrigin20.0200.0sprite_lasersprite_halo0100.66.00.0, {255255255128}, 100);
                        
TE_SendToAll();

                        
informacje_itemu_gracza[client][1] --;
                    }
                    else
                        
PrintToChat(client"[COD:MW] Wykorzystales juz moc swojego itemu w tej rundzie!");

                    
oldbuttons1[client] = 1;
                }
                else if(
oldbuttons1[client] && !(buttons IN_USE))
                    
oldbuttons1[client] = 0;
            }
        }
    }
    else
    {
        new 
spect GetEntProp(clientProp_Send"m_iObserverMode");
        if(
spect == || spect == 5
        {
            new 
target GetEntPropEnt(clientProp_Send"m_hObserverTarget");
            if(!(
target == -1) && IsValidClient(target))
            {
                new 
ile poziom_gracza[target]->= 0doswiadczenie_poziomu[poziom_gracza[target]-1]: 0;
                new 
Float:procent_gracza 0.0;
                
procent_gracza = (float(doswiadczenie_gracza[target]-ile)/float(doswiadczenie_poziomu[poziom_gracza[target]]-ile))*100.0;
                
PrintHintText(client"[Klasa: <b>%s</b>]\n[Prędkość: <b>%.1f</b>]\n[Xp: <b>%0.1f</b>/<b>100.0%%</b> | Lv: <b>%i</b>]\n[Item: <b>%s</b> [<b>%i%%</b>]]</font>"nazwy_klas[klasa_gracza[target]],GetPlayerSpeed(target), procent_graczapoziom_gracza[target], nazwy_itemow[informacje_itemu_gracza[target][0]], moc_itemu[target], GetPlayerSpeed(target));
            }
        }
    }

    return 
Plugin_Continue;
}
stock Float:GetPlayerSpeed(iClient)
{
    new 
Float:faVelocity[3];
    
GetEntPropVector(iClientProp_Data"m_vecVelocity"faVelocity);

    new 
Float:fSpeed;
    
fSpeed SquareRoot(faVelocity[0] * faVelocity[0] + faVelocity[1] * faVelocity[1]);
    
fSpeed *= GetEntPropFloat(iClientProp_Data"m_flLaggedMovementValue");

    return 
fSpeed;


https://zapodaj.net/0157aa12704aa.png.html



The whole plugin looks like this: http://wklej.org/id/3347538/

Last edited by misiakool12; 01-18-2018 at 09:21.
misiakool12 is offline
misiakool12
Member
Join Date: Apr 2016
Old 01-19-2018 , 07:20   Re: Problem with compilation
Reply With Quote #13

Can help , please ?
misiakool12 is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 01-19-2018 , 08:01   Re: Problem with compilation
Reply With Quote #14

I literally copy pasted your code into the plugin code, and it compiles fine (other than FindSendPropOffs warnings).
Also, the errors you showed tell you that it can't compile because the variable g_hRegenTimer doesn't exist, but theres no mention of g_hRegenTimer anywhere in any of the code. So obviously you've done something wrong (pasted wrong file, compiled wrong file, shown wrong errors).

We can't really help you if you don't give us anything to work with.

Last edited by hmmmmm; 01-19-2018 at 08:02.
hmmmmm is offline
misiakool12
Member
Join Date: Apr 2016
Old 01-19-2018 , 09:33   Re: Problem with compilation
Reply With Quote #15

strange, during the compilation I still get the same errors .. Changing the brackets does not help,I gives up
misiakool12 is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 01-19-2018 , 10:45   Re: Problem with compilation
Reply With Quote #16

Here's the code I got by combining your snippet with the page you linked if you want to see if that works for you
Attached Files
File Type: sp Get Plugin or Get Source (3347538.sp - 71 views - 193.3 KB)
hmmmmm is offline
misiakool12
Member
Join Date: Apr 2016
Old 01-19-2018 , 12:06   Re: Problem with compilation
Reply With Quote #17

Thank you, you are great! But now it does not display the string "Item" https://zapodaj.net/6daaeb75dbf22.bmp.html
misiakool12 is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 01-19-2018 , 13:41   Re: Problem with compilation
Reply With Quote #18

Theres too much on the hint text for it to show. I tried putting first 2 things on same line and decreasing font slightly, try it out. If it doesn't work try decreasing font size a bit more.
Attached Files
File Type: sp Get Plugin or Get Source (3347538.sp - 61 views - 193.3 KB)
hmmmmm is offline
misiakool12
Member
Join Date: Apr 2016
Old 01-19-2018 , 14:09   Re: Problem with compilation
Reply With Quote #19

I thank you with all my heart! So you can not set this speed in a new line? https://zapodaj.net/b7b6f4a0e18d9.bmp.html
misiakool12 is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 01-19-2018 , 15:06   Re: Problem with compilation
Reply With Quote #20

You probably could now that you've decreased size.
Mess around with the formatting and see what works. If you want it to be on a new line, change the \t to a \n
\t = tab, \n = newline
hmmmmm 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 09:31.


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