Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: Carera poslato Jun 07, 2018, 14:16:10 POSLE PODNE

Naslov: HP spada
Poruka od: Carera poslato Jun 07, 2018, 14:16:10 POSLE PODNE
Problem(error/warning): u Waru,na DM eventu i slicno,spawnam se nekad sa pola hp i slicno
Dio skripte: [ pawn ][ /pawn ]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): [ code ]vaš odgovor[ /code ]
Slika/video ingame problema(obavezno ako je ingame problem): link slike

  new w = WARPInfo[ playerid ][ WARIgrac ];

SetPlayerVirtualWorld( playerid, w );
Dimi_SetPlayerHealth( playerid, 100 );
Dimi_SetPlayerArmour( playerid, 99 );
antiCheatCS[ playerid ][ TeleportCheck ] = 4;
antiCheatCS[ playerid ][ WeaponDetect ] = 4;
if( WARInfo[ w ][ WARMapa ] == 1 ) {
    new rand1 = random( sizeof( RandomWARMapa11 ) );
    new rand2 = random( sizeof( RandomWARMapa12 ) );
    if( WARPInfo[ playerid ][ WARTim ][ 0 ] == true ) { Dimi_SetPlayerPos( playerid, RandomWARMapa11[ rand1 ][ 0 ], RandomWARMapa11[ rand1 ][ 1 ],RandomWARMapa11[ rand1 ][ 2 ] ); }
    else if( WARPInfo[ playerid ][ WARTim ][ 1 ] == true ) { Dimi_SetPlayerPos( playerid, RandomWARMapa12[ rand2 ][ 0 ], RandomWARMapa12[ rand2 ][ 1 ],RandomWARMapa12[ rand2 ][ 2 ] ); }
SetPlayerInterior( playerid, 0 );
}
else if( WARInfo[ w ][ WARMapa ] == 2 ) {
    new rand1 = random( sizeof( RandomWARMapa21 ) );
    new rand2 = random( sizeof( RandomWARMapa22 ) );
    if( WARPInfo[ playerid ][ WARTim ][ 0 ] == true ) { Dimi_SetPlayerPos( playerid, RandomWARMapa21[ rand1 ][ 0 ], RandomWARMapa21[ rand1 ][ 1 ],RandomWARMapa21[ rand1 ][ 2 ] ); }
    else if( WARPInfo[ playerid ][ WARTim ][ 1 ] == true ) { Dimi_SetPlayerPos( playerid, RandomWARMapa22[ rand2 ][ 0 ], RandomWARMapa22[ rand2 ][ 1 ],RandomWARMapa22[ rand2 ][ 2 ] ); }
SetPlayerInterior( playerid, 10 );
}
else if( WARInfo[ w ][ WARMapa ] == 3 ) {
    new rand1 = random( sizeof( RandomWARMapa31 ) );
    new rand2 = random( sizeof( RandomWARMapa32 ) );
    if( WARPInfo[ playerid ][ WARTim ][ 0 ] == true ) { Dimi_SetPlayerPos( playerid, RandomWARMapa31[ rand1 ][ 0 ], RandomWARMapa31[ rand1 ][ 1 ],RandomWARMapa31[ rand1 ][ 2 ] ); }
    else if( WARPInfo[ playerid ][ WARTim ][ 1 ] == true ) { Dimi_SetPlayerPos( playerid, RandomWARMapa32[ rand2 ][ 0 ], RandomWARMapa32[ rand2 ][ 1 ],RandomWARMapa32[ rand2 ][ 2 ] ); }
            SetPlayerInterior( playerid, 0 );
}
else if( WARInfo[ w ][ WARMapa ] == 4 ) {
    new rand1 = random( sizeof( RandomWARMapa41 ) );
    new rand2 = random( sizeof( RandomWARMapa42 ) );
    if( WARPInfo[ playerid ][ WARTim ][ 0 ] == true ) { Dimi_SetPlayerPos( playerid, RandomWARMapa41[ rand1 ][ 0 ], RandomWARMapa41[ rand1 ][ 1 ], RandomWARMapa41[ rand1 ][ 2 ] ); }
    else if( WARPInfo[ playerid ][ WARTim ][ 1 ] == true ) { Dimi_SetPlayerPos( playerid, RandomWARMapa42[ rand2 ][ 0 ], RandomWARMapa42[ rand2 ][ 1 ], RandomWARMapa42[ rand2 ][ 2 ] ); }
            SetPlayerInterior( playerid, 0 );
}
else if( WARInfo[ w ][ WARMapa ] == 5 ) {
    new rand1 = random( sizeof( RandomWARMapa51 ) );
    new rand2 = random( sizeof( RandomWARMapa52 ) );
    if( WARPInfo[ playerid ][ WARTim ][ 0 ] == true ) { Dimi_SetPlayerPos( playerid, RandomWARMapa51[ rand1 ][ 0 ], RandomWARMapa51[ rand1 ][ 1 ],RandomWARMapa51[ rand1 ][ 2 ] ); }
    else if( WARPInfo[ playerid ][ WARTim ][ 1 ] == true ) { Dimi_SetPlayerPos( playerid, RandomWARMapa52[ rand2 ][ 0 ], RandomWARMapa52[ rand2 ][ 1 ],RandomWARMapa52[ rand2 ][ 2 ] ); }
    SetPlayerInterior( playerid, 0 );
}
GiveWeaponToPlayer( playerid, WARInfo[ w ][ WAROruzje ][ 0 ], 300 );
GiveWeaponToPlayer( playerid, WARInfo[ w ][ WAROruzje ][ 1 ], 300 );
GiveWeaponToPlayer( playerid, WARInfo[ w ][ WAROruzje ][ 2 ], 300 );
GiveWeaponToPlayer( playerid, WARInfo[ w ][ WAROruzje ][ 3 ], 300 );

PlayerInfo[ playerid ][ xSpawned ] = 1;

return true;
    }
    else if( NaDmEventu[ playerid ] == true ) {
       
        new rand = random( sizeof( RandomDMPos ) );
Dimi_SetPlayerPos( playerid, RandomDMPos[ rand ][ 0 ], RandomDMPos[ rand ][ 1 ],RandomDMPos[ rand ][ 2 ] );
SetPlayerFacingAngle( playerid, 360.000 );
SetCameraBehindPlayer( playerid );
SetPlayerInterior( playerid, 0 );
SetPlayerVirtualWorld( playerid, 10 );

        PlayerInfo[ playerid ][ xSpawned ] = 1;

if( PlayerInfo[ playerid ][ xDMEventUbistva ] >= 4500 ) {
    GiveWeaponToPlayer( playerid, 24, 150 );
GiveWeaponToPlayer( playerid, 26, 150 );
GiveWeaponToPlayer( playerid, 28, 400 );
GiveWeaponToPlayer( playerid, 31, 400 );
SetPlayerSkillLevel( playerid, WEAPONSKILL_MICRO_UZI, 999 );
SetPlayerSkillLevel( playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 999 );
}
else if( PlayerInfo[ playerid ][ xDMEventUbistva ] >= 4000 ) {
    GiveWeaponToPlayer( playerid, 24, 150 );
GiveWeaponToPlayer( playerid, 27, 150 );
GiveWeaponToPlayer( playerid, 32, 800 );
GiveWeaponToPlayer( playerid, 31, 400 );
SetPlayerSkillLevel( playerid, WEAPONSKILL_MICRO_UZI, 999 );
}
else if( PlayerInfo[ playerid ][ xDMEventUbistva ] >= 3500 ) {
    GiveWeaponToPlayer( playerid, 24, 150 );
GiveWeaponToPlayer( playerid, 27, 150 );
GiveWeaponToPlayer( playerid, 28, 800 );
GiveWeaponToPlayer( playerid, 31, 400 );
SetPlayerSkillLevel( playerid, WEAPONSKILL_MICRO_UZI, 999 );
}
else if( PlayerInfo[ playerid ][ xDMEventUbistva ] >= 3000 ) {
    GiveWeaponToPlayer( playerid, 24, 150 );
GiveWeaponToPlayer( playerid, 27, 150 );
GiveWeaponToPlayer( playerid, 29, 400 );
GiveWeaponToPlayer( playerid, 31, 400 );
}
else if( PlayerInfo[ playerid ][ xDMEventUbistva ] >= 2500 ) {
    GiveWeaponToPlayer( playerid, 24, 150 );
GiveWeaponToPlayer( playerid, 26, 150 );
GiveWeaponToPlayer( playerid, 29, 400 );
GiveWeaponToPlayer( playerid, 31, 400 );
}
else if( PlayerInfo[ playerid ][ xDMEventUbistva ] >= 2000 ) {
GiveWeaponToPlayer( playerid, 24, 150 );
GiveWeaponToPlayer( playerid, 26, 150 );
GiveWeaponToPlayer( playerid, 29, 400 );
GiveWeaponToPlayer( playerid, 30, 400 );
}
else if( PlayerInfo[ playerid ][ xDMEventUbistva ] >= 1500 ) {
GiveWeaponToPlayer( playerid, 24, 150 );
GiveWeaponToPlayer( playerid, 25, 100 );
GiveWeaponToPlayer( playerid, 29, 400 );
GiveWeaponToPlayer( playerid, 31, 400 );
}
else if( PlayerInfo[ playerid ][ xDMEventUbistva ] >= 1000 ) {
GiveWeaponToPlayer( playerid, 24, 150 );
GiveWeaponToPlayer( playerid, 25, 100 );
GiveWeaponToPlayer( playerid, 29, 400 );
GiveWeaponToPlayer( playerid, 30, 400 );
}
else if( PlayerInfo[ playerid ][ xDMEventUbistva ] >= 500 ) {
GiveWeaponToPlayer( playerid, 24, 200 );
GiveWeaponToPlayer( playerid, 25, 100 );
GiveWeaponToPlayer( playerid, 29, 400 );
}
else if( PlayerInfo[ playerid ][ xDMEventUbistva ] >= 0 ) {
GiveWeaponToPlayer( playerid, 24, 200 );
GiveWeaponToPlayer( playerid, 25, 100 );
}

Dimi_SetPlayerHealth( playerid, 100 );
Dimi_SetPlayerArmour( playerid, 99 );
Naslov: Odg: HP spada
Poruka od: Carera poslato Jun 07, 2018, 14:20:36 POSLE PODNE
Isto se zna desiti ponekad kada podesim nekom hp da mu bude pun pa spadne pa mu moram 2 put podesit hp i tjt
Naslov: Odg: HP spada
Poruka od: ᗪ卂乂 poslato Jun 08, 2018, 20:08:48 POSLE PODNE
Pa imas neki updejt gde ti on po nekad stavi hp na 50, a moguce i da je do anti cita, aj pokusaj da stavis umesto da mu seta 100 hp ti stavi 99
Naslov: Odg: HP spada
Poruka od: Balsa. poslato Jun 09, 2018, 00:29:24 PRE PODNE
Stavi da mu seta hp na 100 tu gde si stavio da daje oruzje (svako mjesto)
Naslov: Odg: HP spada
Poruka od: Carera poslato Jun 09, 2018, 10:52:40 PRE PODNE

stock AntiCheat( playerid ) {
if( PlayerLogged[ playerid ] == true ) {
// -- Anti Health
if( antiCheatSS[ antiHealthH  ] == true ) {
new Float:Zivot;
GetPlayerHealth( playerid, Zivot );
    if( KodSprunk( playerid ) ) {
Dimi_SetPlayerHealth( playerid, Zivot );
return 1;
}
if( Zivot > antiCheatCS[ playerid ][ TrueHealth ] && !KodSprunk( playerid ) ) {
Dimi_SetPlayerHealth( playerid, antiCheatCS[ playerid ][ TrueHealth ] );
return 1;
}
antiCheatCS[ playerid ][ TrueHealth ] = Zivot;
}

// -- Anti Vehicle Repair
if( antiCheatSS[ antiVehRepair ] == true ) {
    if( antiCheatCS[ playerid ][ VehRepairTime ] <= 0 ) {
if( GetPlayerState( playerid ) == PLAYER_STATE_DRIVER ) {
                new vehicleid = GetPlayerVehicleID( playerid ), Float:vHealth;
                GetVehicleHealth( vehicleid, vHealth );
                if( vHealth > ( antiCheatVS[ vehicleid ][ VehTrueHealth ]+10 ) ) {
            if( antiCheatVS[ vehicleid ][ VehCheck ] == 1 && !AdminDuty[ playerid ] && !IsVehicleLetelica( GetPlayerVehicleID( playerid ) ) ) {
if( !IsPlayerAtVehicleRepairPoint( playerid ) ) {
                            OnPlayerCheat( playerid, DETECT_VEHREPAIR_HACK, 0, 0 );
                            Dimi_SetVehicleHealth( vehicleid, antiCheatVS[ vehicleid ][ VehTrueHealth ] );
                            antiCheatCS[ playerid ][ VehRepairTime ] = 3;
}
    }
        }
                antiCheatVS[ vehicleid ][ VehTrueHealth ] = vHealth;
}
}
else {
antiCheatCS[ playerid ][ VehRepairTime ]--;
}
}
// -- Anti Armour
if( antiCheatSS[ antiArmourH ] == true ) {
new Float:Armour;
    GetPlayerArmour( playerid, Armour );
    if( Armour > antiCheatCS[ playerid ][ TrueArmour ] ) {
Dimi_SetPlayerArmour( playerid, antiCheatCS[ playerid ][ TrueArmour ] );
return 1;
}
antiCheatCS[ playerid ][ TrueArmour ] = Armour;
}


stock Dimi_SetPlayerHealth( playerid, Float:Zivot ) {

if( Zivot < 0.0 ) {
Zivot = 0.0;
}
if( Zivot > 100.0 ) {
Zivot = 100.0;
}

SetPlayerHealth( playerid, Zivot );
antiCheatCS[ playerid ][ TrueHealth ] = Zivot;
return true;
}
stock DodajIgracuHP( playerid, value)
{
  new Float:Health; GetPlayerHealth( playerid, Health); Dimi_SetPlayerHealth( playerid, Health+value);
}

Naslov: Odg: HP spada
Poruka od: Carera poslato Jun 09, 2018, 10:55:52 PRE PODNE
Citat: á—ªå,ä¹, poslato Jun 08, 2018, 20:08:48 POSLE PODNE
Pa imas neki updejt gde ti on po nekad stavi hp na 50, a moguce i da je do anti cita, aj pokusaj da stavis umesto da mu seta 100 hp ti stavi 99
Ne znam za to,ima komanda warnapusti i tu je dodano ovo
   Dimi_SetPlayerHealth( playerid, 100 );
   Dimi_SetPlayerArmour( playerid, 0 );
i kada napusti 100hp mu je