Crash Detected.
#1

Код:
Gamemode Crash Detected: 
Код:
SA-MP Server: 0.3e-R2



Exception At Address: 0x66105CC2 Module: (crashdetect.DLL)



Registers:

EAX: 0x03A36910	EBX: 0x00000001	ECX: 0x00000081	EDX: 0x2E000000

ESI: 0x0222B578	EDI: 0x03773C4C	EBP: 0x0018FB68	ESP: 0x0018FB28

EFLAGS: 0x00010206



Stack:

+0000: 0x000000D6   0x0292F1D8   0x00000000   0x002C2CE0

+0010: 0x03770020   0x00287BD8   0x00000056   0x00000000

+0020: 0x03773C30   0x023319FC   0x023359F8   0x03A36910

+0030: 0x023319FC   0x00000000   0x02335720   0x023359F0

+0040: 0x0018FBB4   0x660FD0CA   0x00000001   0x0018FC1C

+0050: 0x000000D6   0x66116684   0x027B7B90   0x0018FB94

+0060: 0x00000000   0x0222B578   0x02C28FA0   0x00000001

+0070: 0x0222B578   0x00000000   0x00000008   0x000000D6

+0080: 0x00000000   0x02C28FA0   0x0222B578   0x0018FBEC

+0090: 0x66104E8E   0x0018FC1C   0x000000D6   0xBE177797

+00A0: 0x00000000   0x0222B578   0x0292F1D8   0x02929588

+00B0: 0x0292F1D8   0x02929588   0x0018FE08   0x6610C840

+00C0: 0x00000001   0x02C2B1EA   0x0046DF66   0x0222B578

+00D0: 0x0018FC1C   0x000000D6   0x0222B578   0x00000000

+00E0: 0x0222B578   0x00000084   0x0222B578   0x00000080

+00F0: 0x02C28FA0   0x00000000   0x000000D6   0x0047F8FE

+0100: 0x00000000   0x00000084   0x00000080   0x00000000

+0110: 0x004823FC   0x0637E9F8   0x002A9000   0x00000000

+0120: 0x02C28FA0   0x3C8B2E88   0xBF7FF68A   0x00000000

+0130: 0x02929588   0x3F7FF68A   0x3C8B2E88   0x00000000



--------------------------
Server LOG:
Код:
[16:34:20] [debug] Server crashed while executing enrp.amx
[16:34:20] [debug] Backtrace:
[16:34:20] [debug] #0  00000014 in public OnPlayerKeyStateChange () from enrp.amx
[16:34:20] [debug] Thread backtrace:
[16:34:20] [debug] #0  66101430 in Load () from C:\Users\David\Desktop\SERVER UFFICIALE\plugins\crashdetect.DLL
[16:34:20] [debug] #1  66102735 in Load () from C:\Users\David\Desktop\SERVER UFFICIALE\plugins\crashdetect.DLL
[16:34:20] [debug] #2  6610405E in Load () from C:\Users\David\Desktop\SERVER UFFICIALE\plugins\crashdetect.DLL
[16:34:20] [debug] #3  7478003F in GetProfileStringW () from C:\Windows\syswow64\kernel32.dll
[16:34:20] [debug] #4  0049DCF6 in ?? () from C:\Users\David\Desktop\SERVER UFFICIALE\samp-server.exe
[16:34:20] [debug] #5  00497131 in ?? () from C:\Users\David\Desktop\SERVER UFFICIALE\samp-server.exe
[16:34:20] [debug] #6  747433AA in BaseThreadInitThunk () from C:\Windows\syswow64\kernel32.dll
[16:34:20] [debug] #7  77029EF2 in RtlInitializeExceptionChain () from C:\Windows\SysWOW64\ntdll.dll
[16:34:20] [debug] #8  77029EC5 in RtlInitializeExceptionChain () from C:\Windows\SysWOW64\ntdll.dll
Please help me.
Reply
#2

show "OnPlayerKeyStateChange" from enrp.pwn, maybe we can help.
Reply
#3

Quote:
Originally Posted by airplanesimen
Посмотреть сообщение
show "OnPlayerKeyStateChange" from enrp.pwn, maybe we can help.
PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    new 
string[128];
    new 
sendername[MAX_PLAYER_NAME];
    new 
giveplayer[MAX_PLAYER_NAME];
    if (
IsAtPGarbage(playerid))
        {
        if(
newkeys == KEY_CROUCH)
        {
            
GetPlayerName(playeridsendernamesizeof(sendername));
            
GiveNameSpace(sendername);
            if(
PlayerInfo[playerid][pMaskUse] == 1)
            {
                
format(sendernamesizeof(sendername), "[Mask_%d_38]"RandMask[playerid]);
            }
            new 
dice random(15)+1;
            
ClearAnimations(playerid);
            if(
dice == 1)
            {
                
format(stringsizeof(string), "* %s leans over and picks threw the garbage and finds a dirty Burger Shot Hamburger."sendername);
                
SendClientMessage(playerid,COLOR_GRAD3,"You found a dirty old half eaten hamburger, Throw it away!");
            }
            else if(
dice == 2)
            {
                
format(stringsizeof(string), "* %s leans over and picks threw the garbage and finds a used condom."sendername);
                
SendClientMessage(playerid,COLOR_GRAD3,"You found s used condom!");
            }
            else if(
dice == 3)
            {
                
format(stringsizeof(string), "* %s leans over and picks threw the garbage and finds a hotdog."sendername);
                
SendClientMessage(playerid,COLOR_GRAD3,"You found a hotdog!");
                new 
Float:PlayersArmour;
                
GetPlayerHealth(playeridPlayersArmour);
                
SetPlayerHealthExs(playeridPlayersArmour 5.0);
            }
            else if(
dice == 4)
            {
                
format(stringsizeof(string), "* %s leans over and picks threw the garbage and finds a Banana Peal."sendername);
                
SendClientMessage(playerid,COLOR_GRAD3,"You found a Banana Peal");
            }
            else if(
dice == 5)
            {
                
format(stringsizeof(string), "* %s leans over and picks threw the garbage and finds a dead rat."sendername);
                
SendClientMessage(playerid,COLOR_GRAD3,"You found a dead rat!");
            }
            else if(
dice == 6)
            {
                
format(stringsizeof(string), "* %s leans over and picks threw the garbage and finds a used dildo."sendername);
                
SendClientMessage(playerid,COLOR_GRAD3,"You found a dildo!");
                
GivePlayerWeaponEx(playerid,10,1);
            }
            else if(
dice == 7)
            {
                
format(stringsizeof(string), "* %s leans over and picks threw the garbage and finds a broken pool cue."sendername);
                
SendClientMessage(playerid,COLOR_GRAD3,"You found a pool cue!");
                
GivePlayerWeaponEx(playerid,7,1);
            }
            else
            {
                
format(stringsizeof(string), "* %s leans over and picks threw the garbage and finds nothing of value."sendername);
                
SendClientMessage(playerid,COLOR_GRAD3,"You found nothing!");
            }
            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
// Place Bomb
            
ApplyAnimationEx(playerid"BOMBER""BOM_Plant"4.000000);
            return 
1;
        }
    }
      if(((
oldkeys KEY_FIRE) && !(newkeys KEY_FIRE)) || ((newkeys KEY_FIRE) && !(oldkeys KEY_FIRE)) ||  (newkeys KEY_FIRE)) {
           for(new 
0GetMaxPlayers(); i++)
        {
            if(
IsPlayerConnected(i) && playerid != && !IsPlayerNPC(i)) {
                if(
IsPlayerAiming(playeridi)) {
                    if(
PlayerInfo[playerid][pMember] == && GetPlayerWeapon(playerid) == 23 || PlayerInfo[playerid][pMember] == && GetPlayerWeapon(playerid) == 23  || PlayerInfo[playerid][pMember] == 14 && GetPlayerWeapon(playerid) == 23 ||  PlayerInfo[playerid][pGuard] == && GetPlayerWeapon(playerid) == 23) {
                            if(
IsPlayerInAnyVehicle(i) || IsPlayerInAnyVehicle(i)) {
                                return 
0;
                            }
//SetPlayerHealth(i, 0);             GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
                            
GetPlayerName(playeridsendernamesizeof(sendername));
                            
GetPlayerName(igiveplayersizeof(giveplayer));
                            
format(stringsizeof(string), "* %s shoots with there Tazer which hooks onto %s and tazes him to the ground."sendername ,giveplayer);
                            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                            
TogglePlayerControllable(i0);
                            
GameTextForPlayer(i"~p~(Tazed)"30003);
                            
GameTextForPlayer(playerid"~r~(Tazed) Complete"30003);
                            
SetTimerEx("FallPlayer"10000"d"i);
                            
SetTimerEx("UnTaze",200000"d",i);
                            
SetPlayerDrunkLevel(i3000);
                           
// SetPlayerHealth(i,100);
                            
Usinganim[i]  = 1;
                               
Tazed[i] = 1;
                            return 
1;
                }
            }
        }
    }
    if (((
newkeys KEY_WALK && newkeys KEY_UP) || (newkeys KEY_WALK && newkeys KEY_DOWN) || (newkeys KEY_WALK && newkeys KEY_LEFT) || (newkeys KEY_WALK && newkeys KEY_RIGHT))
        || ((
oldkeys KEY_WALK && newkeys KEY_UP) || (oldkeys KEY_WALK && newkeys KEY_DOWN) || (oldkeys KEY_WALK && newkeys KEY_LEFT) || (oldkeys KEY_WALK && newkeys KEY_RIGHT))
        || ((
newkeys KEY_WALK && oldkeys KEY_UP) || (newkeys KEY_WALK && oldkeys KEY_DOWN) || (newkeys KEY_WALK && oldkeys KEY_LEFT) || (newkeys KEY_WALK && oldkeys KEY_RIGHT))
        && 
GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
        
walktime[playerid] = SetTimerEx("WalkAnim",200,0,"d",playerid);
   }
    if(
newkeys == KEY_SPRINT || newkeys == KEY_FIRE || newkeys == KEY_CROUCH)
    {
        if(
RegistrationStep[playerid] == || RegistrationStep[playerid] == 4)
        {
            
RegistrationStep[playerid]=5;
        }
    }
    if(
newkeys KEY_FIRE && oldkeys KEY_CROUCH && IsCbugWeapon(playerid))
    {
        if(
PlayerInfo[playerid][pAdmin] <= 9)
        {
            
ApplyAnimationEx(playerid"SILENCED""Silence_reload"3.000000);
        }
    }
    if(
oldkeys KEY_FIRE && newkeys KEY_CROUCH && IsCbugWeapon(playerid))
    {
        if(
PlayerInfo[playerid][pAdmin] <= 9)
        {
            
ApplyAnimationEx(playerid"SILENCED""Silence_reload"3.000000);
        }
    }
    if(
PRESSED(KEY_SPRINT))
    {
        if(
PlayerisTut[playerid] >= 1)
        {
            if(
PlayerisTut[playerid] == 1)
            {
                
PlayerisTut[playerid] = 2;
                
SetPlayerPos(playerid,1279.6980,-1542.4175,13.5274);
                
SetPlayerCameraPos(playerid,1299.7954,-1594.4066,35.6015);//Driving School
                
SetPlayerCameraLookAt(playerid,1279.6980,-1542.4175,13.5274);
                
format(string,sizeof(string),"Driving school ~n~You will be able to take a driving test here for 5000$");
                
TextDrawSetString(Textdraw98[playerid],string);
                
TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
                
SendClientMessage(playerid,COLOR_WHITE,"{FF6633}Use SPACEBAR to continue,SHIFT to go back.");
                return 
1;
            }
            if(
PlayerisTut[playerid] == 2)
            {
                
PlayerisTut[playerid] = 3;
                   
SetPlayerPos(playerid1221.7010,-1328.6449,-5.00);
                
SetPlayerCameraPos(playerid1204.3781,-1313.3323,16.3984);
                
SetPlayerCameraLookAt(playerid1174.7167,-1323.4485,14.5938);
                
format(string,sizeof(string),"If you're feeling sick~n~come to the hospital~n~to get healed and fixed by the EMS");
                
TextDrawSetString(Textdraw98[playerid],string);
                
TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
                
SendClientMessage(playerid,COLOR_WHITE,"{FF6633}Tutorial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
                return 
1;
            }
            if(
PlayerisTut[playerid] == 3)
            {
                
PlayerisTut[playerid] = 4;
                
SetPlayerPos(playerid,590.7849,-1243.1808,17.9521);
                
SetPlayerCameraPos(playerid,609.0580,-1219.5914,29.2979);//Bank
                
SetPlayerCameraLookAt(playerid,590.7849,-1243.1808,17.9521);
                
format(string,sizeof(string),"Bank is located here~n~You can get your paychecks by~n~going over to the money icon~n~COMMANDS:/withdraw,/savings,/deposit,/transfer");
                
TextDrawSetString(Textdraw98[playerid],string);
                
TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
                
SendClientMessage(playerid,COLOR_WHITE,"{FF6633}Tutorial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
                return 
1;
            }
            if(
PlayerisTut[playerid] == 4)
            {
                
PlayerisTut[playerid] = 5;
                
SetPlayerPos(playerid,543.6426,-1277.8851,17.2422);
                
SetPlayerCameraPos(playerid,538.1927,-1259.2106,29.4667);//Grotti Dealership
                
SetPlayerCameraLookAt(playerid,543.6426,-1277.8851,17.2422);
                
format(string,sizeof(string),"You can buy sport vehicles over here if you have enough money.~n~Command:/v.");
                
TextDrawSetString(Textdraw98[playerid],string);
                
TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
                
SendClientMessage(playerid,COLOR_WHITE,"{FF6633}Tutorial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
                return 
1;
            }
            if(
PlayerisTut[playerid] == 5)
            {
                
PlayerisTut[playerid] = 6;
                   
SetPlayerCameraPos(playerid,2125.4453,-1119.0323,37.1580);
                   
SetPlayerCameraLookAt(playerid,2131.0527,-1150.2542,24.1689);
                
SetPlayerPos(playerid,2130.0605,-1119.6272,25.3773);
                
format(string,sizeof(string),"Over here is the other dealership where you can buy non-sport cars.~n~/v for commands");
                
TextDrawSetString(Textdraw98[playerid],string);
                
TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
                
SendClientMessage(playerid,COLOR_WHITE,"{FF6633}Use SPACEBAR to continue,SHIFT to go back.");
                return 
1;
            }
            if(
PlayerisTut[playerid] == 6)
            {
                
PlayerisTut[playerid] = 7;
                   
SetPlayerPos(playerid1786.1758,-1258.4976,-5.00);
                
SetPlayerCameraPos(playerid1779.4259,-1275.1025,15.6328);
                
SetPlayerCameraLookAt(playerid1785.7263,-1296.0200,13.4213);
                
format(string,sizeof(string),"Here is where you can make advertisements ~n~So if you need to make a advertisement.~n~ Come down and /ad or /cad~n~For company advertisement. ");
                
TextDrawSetString(Textdraw98[playerid],string);
                
TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
                
SendClientMessage(playerid,COLOR_WHITE,"{FF6633}Tutorial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
                return 
1;
            }
            if(
PlayerisTut[playerid] == 7)
            {
                
PlayerisTut[playerid] = 0;
                
SetPlayerInterior(playerid0);
                
SetPlayerPos(playerid1642.2334,-2240.4983,13.4952);
                
SetCameraBehindPlayer(playerid);
                
SetPlayerVirtualWorld(playerid0);
                
TogglePlayerControllable(playerid1);
                
TextDrawHideForPlayer(playerid,Textdraw98[playerid]);
                
OnPlayerDataSave(playerid);
                
SetCameraBehindPlayer(playerid);
                
SendClientMessage(playerid,COLOR_WHITE,"{FF6633}Tutorial:{FFFFFF}The tutorial is now finished,good luck!.");
                return 
1;
            }
        }
    }
    if(
PRESSED(LIGHT_KEY))
    {
        if(
IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) == 0)
        {
            if(
GetPVarInt(playerid"CopFlash") == 0)
            {
                new 
panelsdoorslightstires;
                new 
carid GetPlayerVehicleID(playerid);
                
GetVehicleDamageStatus(caridpanelsdoorslightstires);
                switch(
GetPVarInt(playerid"vMainOn"))
                {
                    case 
0:
                    {
                        
lights encode_lights(0000);
                        
SetPVarInt(playerid"vMainOn"1);
                    }
                    case 
1:
                    {
                        
lights encode_lights(1111);
                        
SetPVarInt(playerid"vMainOn"0);
                    }
                }
                
UpdateVehicleDamageStatus(caridpanelsdoorslightstires);
            }
        }
    }
    if(
PRESSED(KEY_CROUCH))
    {
        if(
IsPublicService(GetPlayerVehicleID(playerid)) && GetPlayerVehicleSeat(playerid) == 0)
        {
            switch(
GetPVarInt(playerid"CopFlash"))
            {
                case 
0:
                {
                    
KillTimer(BlinkTime[playerid]);
                    
BlinkTime[playerid] = SetTimerEx("vBlinker"PFLASH_RATE1"i"playerid);
                    
SetPVarInt(playerid"CopFlash"1);
                }
                case 
1:
                {
                    
KillTimer(BlinkTime[playerid]);
                    new 
panelsdoorslightstires;
                    new 
carid GetPlayerVehicleID(playerid);
                    
GetVehicleDamageStatus(caridpanelsdoorslightstires);
                    
lights encode_lights(1111);
                    
UpdateVehicleDamageStatus(caridpanelsdoorslightstires);
                    
SetPVarInt(playerid"CopFlash"0);
                }
            }
        }
    }
    if(
PRESSED(KEY_LOOK_LEFT))
    {
        if(
GetPlayerVehicleSeat(playerid) == 0)
        {
            if(
GetPVarInt(playerid"vBLeft") == 0)
            {
                
KillTimer(BlinkTime[playerid]);
                
BlinkTime[playerid] = SetTimerEx("vBlinker"BLINK_RATE1"i"playerid);
                
SetPVarInt(playerid"vBLeft"1);
                
SetPVarInt(playerid"vBRight"0);
            }
            else
            {
                
KillTimer(BlinkTime[playerid]);
                new 
panelsdoorslightstires;
                new 
carid GetPlayerVehicleID(playerid);
                
GetVehicleDamageStatus(caridpanelsdoorslightstires);
                switch(
GetPVarInt(playerid"vMainOn"))
                {
                    case 
0:
                    {
                        
lights encode_lights(1111);
                    }
                    case 
1:
                    {
                        
lights encode_lights(0000);
                    }
                }
                
UpdateVehicleDamageStatus(caridpanelsdoorslightstires);
                
SetPVarInt(playerid"vBLeft"0);
            }
        }
    }
    if(
PRESSED(KEY_LOOK_RIGHT))
    {
        if(
GetPlayerVehicleSeat(playerid) == 0)
        {
            if(
GetPVarInt(playerid"vBRight") == 0)
            {
                
KillTimer(BlinkTime[playerid]);
                
BlinkTime[playerid] = SetTimerEx("vBlinker"BLINK_RATE1"i"playerid);
                
SetPVarInt(playerid"vBRight"1);
                
SetPVarInt(playerid"vBLeft"0);
            }
            else
            {
                
KillTimer(BlinkTime[playerid]);
                new 
panelsdoorslightstires;
                new 
carid GetPlayerVehicleID(playerid);
                
GetVehicleDamageStatus(caridpanelsdoorslightstires);
                switch(
GetPVarInt(playerid"vMainOn"))
                {
                    case 
0:
                    {
                        
lights encode_lights(1111);
                    }
                    case 
1:
                    {
                        
lights encode_lights(0000);
                    }
                }
                
UpdateVehicleDamageStatus(caridpanelsdoorslightstires);
                
SetPVarInt(playerid"vBRight"0);
            }
        }
        return 
1;
    }
    else if(
newkeys == KEY_SPRINT)
    {
        if(
BenchPressTime[playerid] > 0)
        {
            
PlayerPlaySound(playerid10850.00.00.0);
        }
        else if(
BenchPresses[playerid] > 0)
        {
          if(
BenchPresses[playerid] >= && BenchPresses[playerid] <= 99 && PlayerInfo[playerid][IsUsingWeight] == && IsInMovingTime[playerid] == 0)
        {
            
PlayerInfo[playerid][pPower]+=5.000000;
            
TextDrawDestroy(MovingBox[playerid]);
            
MovingBox[playerid] = TextDrawCreate(PlayerInfo[playerid][pPower], 182.000000"~n~");
            
TextDrawBackgroundColor(MovingBox[playerid], 255);
            
TextDrawFont(MovingBox[playerid], 1);
            
TextDrawLetterSize(MovingBox[playerid], 0.9000000.499999);
            
TextDrawColor(MovingBox[playerid], -1717986817);
            
TextDrawSetOutline(MovingBox[playerid], 0);
            
TextDrawSetProportional(MovingBox[playerid], 1);
            
TextDrawSetShadow(MovingBox[playerid], 1);
            
TextDrawUseBox(MovingBox[playerid], 1);
            
TextDrawBoxColor(MovingBox[playerid], -1);
            
TextDrawTextSize(MovingBox[playerid], 502.0000000.000000);
            
TextDrawShowForPlayer(playerid,MovingBox[playerid]);
            if(
PlayerInfo[playerid][pPower] >= 586.000000)
            {
                
ApplyAnimation(playerid,"benchpress","gym_bp_up_A"4.000010);SetTimerEx("DownObject",2900,false,"u",playerid);
                
IsInMovingTime[playerid] = 1;
                
PlayerInfo[playerid][pReps]+=1;
                
TextDrawDestroy(RepsText[playerid]);
                
format(string,sizeof(string),"Reps: %d",PlayerInfo[playerid][pReps]);
                
RepsText[playerid] = TextDrawCreate(520.000000200.000000string);
                
TextDrawBackgroundColor(RepsText[playerid], 255);
                
TextDrawFont(RepsText[playerid], 2);
                
TextDrawLetterSize(RepsText[playerid], 0.5000001.000000);
                
TextDrawColor(RepsText[playerid], -1);
                
TextDrawSetOutline(RepsText[playerid], 1);
                
TextDrawSetProportional(RepsText[playerid], 1);
                
TextDrawShowForPlayer(playerid,RepsText[playerid]);
                }
                else
                {
                if(
BenchPresses[playerid] >= 99 && PlayerInfo[playerid][IsUsingWeight] == && IsInMovingTime[playerid] == 0)
                {
                
ApplyAnimation(playerid,"benchpress","gym_bp_getoff"4.000111);SetTimerEx("GetUp",2900,false,"u",playerid);
                
KillTimer(ReduceTimer[playerid]);
                
PlayerInfo[playerid][pPower] = 506.000000;
                    
PlayerInfo[playerid][pReps] = 0;
                
IsInMovingTime[playerid] = 0;
                
PlayerInfo[playerid][IsUsingWeight] = 0;
                
TextDrawHideForPlayer(playerid,RepsText[playerid]);
                
TextDrawHideForPlayer(playerid,Box1[playerid]);
                
TextDrawHideForPlayer(playerid,Box2[playerid]);
                
TextDrawHideForPlayer(playerid,MovingBox[playerid]);
                
SetCameraBehindPlayer(playerid);
                
SetTimerEx("BenchPressFinish"7000false"i"playerid);
                }
               }
            }
        }
    }
    else if(
newkeys KEY_FIRE)
    {
        new 
wep GetPlayerWeapon(playerid);
        if(
wep == 38)
        {
            if(
PlayerInfo[playerid][pAdmin] <= 9)
            {
                
RemovePlayerWeaponEx(playeridwep);
                
ApplyAnimationEx(playerid"SILENCED""Silence_reload"3.000000);
            }
        }
    else if(
BenchPresses[playerid] > && PlayerInfo[playerid][IsUsingWeight] == && IsInMovingTime[playerid] == 0)
        {
            
ApplyAnimation(playerid,"benchpress","gym_bp_getoff"4.000111);SetTimerEx("GetUp",2900,false,"u",playerid);
            
KillTimer(ReduceTimer[playerid]);
            
PlayerInfo[playerid][pPower] = 506.000000;
                
PlayerInfo[playerid][pReps] = 0;
            
IsInMovingTime[playerid] = 0;
            
PlayerInfo[playerid][IsUsingWeight] = 0;
            
TextDrawHideForPlayer(playerid,RepsText[playerid]);
            
TextDrawHideForPlayer(playerid,Box1[playerid]);
            
TextDrawHideForPlayer(playerid,Box2[playerid]);
            
TextDrawHideForPlayer(playerid,MovingBox[playerid]);
            
SetCameraBehindPlayer(playerid);
            
SetTimerEx("BenchPressFinish"7000false"i"playerid);
        }
/*    else if(newkeys == KEY_JUMP)
    {
        if(IsPlayerConnected(playerid))
        {
            if(VehAsk[playerid] == 0)
            {
                return 1;
            }
            if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
            {
                return 1;
            }
            if (IsNotAEngineCar(idcar))
            {
                return 1;
            }
            if(idcar >= 135 && idcar <= 154)
            {
                if(HireCar[playerid] != idcar)
                {
                    return 1;
                }
            }
            if(idcar >= 1 && idcar <= 9)
            {
                if(HireCar[playerid] != idcar)
                {
                    return 1;
                }
            }
            if(IsAnOwnableCar(idcar))
            {
                if(PlayerInfo[playerid][pCarkey] == VehicleOwned[idcar])
                {
                }
                else if(PlayerInfo[playerid][pCarkey2] == VehicleOwned[idcar])
                {
                }
                else if(PlayerInfo[playerid][pCarkey3] == VehicleOwned[idcar])
                {
                }
                else
                {
                    return 1;
                }
            }
            if(ReduceTime[playerid] > 0)
            {
                format(string, sizeof(string), " You need to wait %d seconds to type this command.", ReduceTime[playerid]);
                SendClientMessage(playerid, COLOR_GREY, string);
                return 1;
            }
            GetPlayerName(playerid, sendername, sizeof(sendername));
            GiveNameSpace(sendername);
            if(PlayerInfo[playerid][pMaskUse] == 1)
            {
                format(sendername, sizeof(sendername), "[Mask_%d_38]", RandMask[playerid]);
            }
            if (VehicleEngine[idcar] == 0)
            {
                format(string, sizeof(string), "* %s spins the %s's key into the ignition and turns on the engine.", sendername, VehicleName[GetVehicleModel(idcar)-400]);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                new RandomStart;
                RandomStart = random(4);
                switch(RandomStart)
                {
                    case 0,1,2:
                    {
                        if(VehAsk[playerid] == 1)
                        {
                            VehAsk[playerid] = 0;
                            TogglePlayerControllable(playerid,true);
                        }
                        VehicleEngine[idcar] = 1;
                        format(string, sizeof(string), "* %s engine starts (( %s ))", VehicleName[GetVehicleModel(idcar)-400], sendername);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    }
                    case 3:
                    {
                        format(string, sizeof(string), "* %s engine does not start (( %s ))", VehicleName[GetVehicleModel(idcar)-400], sendername);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        ReduceTime[playerid] = 3;
                    }
                }
            }
        }
    }*/
    
else if(((oldkeys KEY_FIRE) && !(newkeys KEY_FIRE)) || ((newkeys KEY_FIRE) && !(oldkeys KEY_FIRE)) ||  (newkeys KEY_FIRE))
    {
        if(
IsPlayerAiming(playerid))
        {
            if(
GetPlayerWeapon(playerid) == 24 || GetPlayerWeapon(playerid) == 30 || GetPlayerWeapon(playerid) == 31 && GetPlayerAmmo(playerid) > 1)
            {
                for(new 
0MAX_PLAYERSi++)
                {
                    if(
== playerid) continue;
                    if(
IsPlayerConnected(i))
                    {
                        if(
GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
                        {
                            if(
IsPlayerAimingTargetBodyPart(playeridi1)) // BODY_PART_HEAD
                            
DoDamage(playeridi1GetPlayerWeapon(playerid)); }
                            else if(
IsPlayerAimingTargetBodyPart(playeridi2)) // BODY_PART_TORSO
                            
DoDamage(playeridi2GetPlayerWeapon(playerid)); }
                            else if(
IsPlayerAimingTargetBodyPart(playeridi3)) // BODY_PART_LEGS
                            
DoDamage(playeridi3GetPlayerWeapon(playerid)); }
                        }
                    }
                }
            }
        }
    }
    return 
1;
}
    else if(
newkeys == KEY_SECONDARY_ATTACK)
    {
        if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            if(
VehAsk[playerid] == 1)
            {
                
VehAsk[playerid] = 0;
                
TogglePlayerControllable(playerid,true);
                
RemovePlayerFromVehicle(playerid);
                }
            }
        }
       } 
Код:
C:\Users\David\Desktop\SERVER UFFICIALE\gamemodes\enrp.pwn(9027) : warning 209: function "S@@_OnPlayerKeyStateChange" should return a value
Reply
#4

Quote:

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new string[128];
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
if (IsAtPGarbage(playerid))
{
if(newkeys == KEY_CROUCH)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GiveNameSpace(sendername);
if(PlayerInfo[playerid][pMaskUse] == 1)
{
format(sendername, sizeof(sendername), "[Mask_%d_38]", RandMask[playerid]);
}
new dice = random(15)+1;
ClearAnimations(playerid);
if(dice == 1)
{
format(string, sizeof(string), "* %s leans over and picks threw the garbage and finds a dirty Burger Shot Hamburger.", sendername);
SendClientMessage(playerid,COLOR_GRAD3,"You found a dirty old half eaten hamburger, Throw it away!");

}
else if(dice == 2)
{
format(string, sizeof(string), "* %s leans over and picks threw the garbage and finds a used condom.", sendername);
SendClientMessage(playerid,COLOR_GRAD3,"You found s used condom!");

}
else if(dice == 3)
{
format(string, sizeof(string), "* %s leans over and picks threw the garbage and finds a hotdog.", sendername);
SendClientMessage(playerid,COLOR_GRAD3,"You found a hotdog!");
new Float:PlayersArmour;
GetPlayerHealth(playerid, PlayersArmour);
SetPlayerHealthExs(playerid, PlayersArmour + 5.0);

}
else if(dice == 4)
{
format(string, sizeof(string), "* %s leans over and picks threw the garbage and finds a Banana Peal.", sendername);
SendClientMessage(playerid,COLOR_GRAD3,"You found a Banana Peal");

}
else if(dice == 5)
{
format(string, sizeof(string), "* %s leans over and picks threw the garbage and finds a dead rat.", sendername);
SendClientMessage(playerid,COLOR_GRAD3,"You found a dead rat!");

}
else if(dice == 6)
{
format(string, sizeof(string), "* %s leans over and picks threw the garbage and finds a used dildo.", sendername);
SendClientMessage(playerid,COLOR_GRAD3,"You found a dildo!");
GivePlayerWeaponEx(playerid,10,1);

}
else if(dice == 7)
{
format(string, sizeof(string), "* %s leans over and picks threw the garbage and finds a broken pool cue.", sendername);
SendClientMessage(playerid,COLOR_GRAD3,"You found a pool cue!");
GivePlayerWeaponEx(playerid,7,1);

}
else
{
format(string, sizeof(string), "* %s leans over and picks threw the garbage and finds nothing of value.", sendername);
SendClientMessage(playerid,COLOR_GRAD3,"You found nothing!");

}
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
// Place Bomb
ApplyAnimationEx(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
return 1;

}

}

if(((oldkeys & KEY_FIRE) && !(newkeys & KEY_FIRE)) || ((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE)) || (newkeys & KEY_FIRE)) {
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i) && playerid != i && !IsPlayerNPC(i)) {
if(IsPlayerAiming(playerid, i)) {
if(PlayerInfo[playerid][pMember] == 1 && GetPlayerWeapon(playerid) == 23 || PlayerInfo[playerid][pMember] == 2 && GetPlayerWeapon(playerid) == 23 || PlayerInfo[playerid][pMember] == 14 && GetPlayerWeapon(playerid) == 23 || PlayerInfo[playerid][pGuard] == 1 && GetPlayerWeapon(playerid) == 23) {

if(IsPlayerInAnyVehicle(i) || IsPlayerInAnyVehicle(i)) {
return 0;
}
//SetPlayerHealth(i, 0); GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(i, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* %s shoots with there Tazer which hooks onto %s and tazes him to the ground.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
TogglePlayerControllable(i, 0);
GameTextForPlayer(i, "~p~(Tazed)", 3000, 3);
GameTextForPlayer(playerid, "~r~(Tazed) Complete", 3000, 3);
SetTimerEx("FallPlayer", 1000, 0, "d", i);
SetTimerEx("UnTaze",20000, 0, "d",i);
SetPlayerDrunkLevel(i, 3000);
// SetPlayerHealth(i,100);
Usinganim[i] = 1;
Tazed[i] = 1;
return 1;



}
}
}
}
if (((newkeys & KEY_WALK && newkeys & KEY_UP) || (newkeys & KEY_WALK && newkeys & KEY_DOWN) || (newkeys & KEY_WALK && newkeys & KEY_LEFT) || (newkeys & KEY_WALK && newkeys & KEY_RIGHT))
|| ((oldkeys & KEY_WALK && newkeys & KEY_UP) || (oldkeys & KEY_WALK && newkeys & KEY_DOWN) || (oldkeys & KEY_WALK && newkeys & KEY_LEFT) || (oldkeys & KEY_WALK && newkeys & KEY_RIGHT))
|| ((newkeys & KEY_WALK && oldkeys & KEY_UP) || (newkeys & KEY_WALK && oldkeys & KEY_DOWN) || (newkeys & KEY_WALK && oldkeys & KEY_LEFT) || (newkeys & KEY_WALK && oldkeys & KEY_RIGHT))
&& GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
walktime[playerid] = SetTimerEx("WalkAnim",200,0,"d",playerid);

}
if(newkeys == KEY_SPRINT || newkeys == KEY_FIRE || newkeys == KEY_CROUCH)
{
if(RegistrationStep[playerid] == 5 || RegistrationStep[playerid] == 4)
{
RegistrationStep[playerid]=5;

}

}
if(newkeys & KEY_FIRE && oldkeys & KEY_CROUCH && IsCbugWeapon(playerid))
{
if(PlayerInfo[playerid][pAdmin] <= 9)
{
ApplyAnimationEx(playerid, "SILENCED", "Silence_reload", 3.0, 0, 0, 0, 0, 0);

}

}
if(oldkeys & KEY_FIRE && newkeys & KEY_CROUCH && IsCbugWeapon(playerid))
{
if(PlayerInfo[playerid][pAdmin] <= 9)
{
ApplyAnimationEx(playerid, "SILENCED", "Silence_reload", 3.0, 0, 0, 0, 0, 0);

}

}
if(PRESSED(KEY_SPRINT))
{
if(PlayerisTut[playerid] >= 1)
{
if(PlayerisTut[playerid] == 1)
{
PlayerisTut[playerid] = 2;
SetPlayerPos(playerid,1279.6980,-1542.4175,13.5274);
SetPlayerCameraPos(playerid,1299.7954,-1594.4066,35.6015);//Driving School
SetPlayerCameraLookAt(playerid,1279.6980,-1542.4175,13.5274);
format(string,sizeof(string),"Driving school ~n~You will be able to take a driving test here for 5000$");
TextDrawSetString(Textdraw98[playerid],string);
TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
SendClientMessage(playerid,COLOR_WHITE,"{FF6633}Us e SPACEBAR to continue,SHIFT to go back.");
return 1;
}
if(PlayerisTut[playerid] == 2)
{
PlayerisTut[playerid] = 3;
SetPlayerPos(playerid, 1221.7010,-1328.6449,-5.00);
SetPlayerCameraPos(playerid, 1204.3781,-1313.3323,16.3984);
SetPlayerCameraLookAt(playerid, 1174.7167,-1323.4485,14.593;
format(string,sizeof(string),"If you're feeling sick~n~come to the hospital~n~to get healed and fixed by the EMS");
TextDrawSetString(Textdraw98[playerid],string);
TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
SendClientMessage(playerid,COLOR_WHITE,"{FF6633}Tu torial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
return 1;
}
if(PlayerisTut[playerid] == 3)
{
PlayerisTut[playerid] = 4;
SetPlayerPos(playerid,590.7849,-1243.1808,17.9521);
SetPlayerCameraPos(playerid,609.0580,-1219.5914,29.2979);//Bank
SetPlayerCameraLookAt(playerid,590.7849,-1243.1808,17.9521);
format(string,sizeof(string),"Bank is located here~n~You can get your paychecks by~n~going over to the money icon~n~COMMANDS:/withdraw,/savings,/deposit,/transfer");
TextDrawSetString(Textdraw98[playerid],string);
TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
SendClientMessage(playerid,COLOR_WHITE,"{FF6633}Tu torial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
return 1;
}
if(PlayerisTut[playerid] == 4)
{
PlayerisTut[playerid] = 5;
SetPlayerPos(playerid,543.6426,-1277.8851,17.2422);
SetPlayerCameraPos(playerid,538.1927,-1259.2106,29.4667);//Grotti Dealership
SetPlayerCameraLookAt(playerid,543.6426,-1277.8851,17.2422);
format(string,sizeof(string),"You can buy sport vehicles over here if you have enough money.~n~Command:/v.");
TextDrawSetString(Textdraw98[playerid],string);
TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
SendClientMessage(playerid,COLOR_WHITE,"{FF6633}Tu torial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
return 1;
}
if(PlayerisTut[playerid] == 5)
{
PlayerisTut[playerid] = 6;
SetPlayerCameraPos(playerid,2125.4453,-1119.0323,37.1580);
SetPlayerCameraLookAt(playerid,2131.0527,-1150.2542,24.1689);
SetPlayerPos(playerid,2130.0605,-1119.6272,25.3773);
format(string,sizeof(string),"Over here is the other dealership where you can buy non-sport cars.~n~/v for commands");
TextDrawSetString(Textdraw98[playerid],string);
TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
SendClientMessage(playerid,COLOR_WHITE,"{FF6633}Us e SPACEBAR to continue,SHIFT to go back.");
return 1;
}
if(PlayerisTut[playerid] == 6)
{
PlayerisTut[playerid] = 7;
SetPlayerPos(playerid, 1786.1758,-1258.4976,-5.00);
SetPlayerCameraPos(playerid, 1779.4259,-1275.1025,15.632;
SetPlayerCameraLookAt(playerid, 1785.7263,-1296.0200,13.4213);
format(string,sizeof(string),"Here is where you can make advertisements ~n~So if you need to make a advertisement.~n~ Come down and /ad or /cad~n~For company advertisement. ");
TextDrawSetString(Textdraw98[playerid],string);
TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
SendClientMessage(playerid,COLOR_WHITE,"{FF6633}Tu torial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
return 1;
}
if(PlayerisTut[playerid] == 7)
{
PlayerisTut[playerid] = 0;
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1642.2334,-2240.4983,13.4952);
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 1);
TextDrawHideForPlayer(playerid,Textdraw98[playerid]);
OnPlayerDataSave(playerid);
SetCameraBehindPlayer(playerid);
SendClientMessage(playerid,COLOR_WHITE,"{FF6633}Tu torial:{FFFFFF}The tutorial is now finished,good luck!.");
return 1;
}
}
}


if(PRESSED(LIGHT_KEY))
{
if(IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) == 0)
{
if(GetPVarInt(playerid, "CopFlash") == 0)
{
new panels, doors, lights, tires;
new carid = GetPlayerVehicleID(playerid);
GetVehicleDamageStatus(carid, panels, doors, lights, tires);
switch(GetPVarInt(playerid, "vMainOn"))
{
case 0:

{
lights = encode_lights(0, 0, 0, 0);
SetPVarInt(playerid, "vMainOn", 1);

}
case 1:

{
lights = encode_lights(1, 1, 1, 1);
SetPVarInt(playerid, "vMainOn", 0);

}

}
UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);

}

}

}

if(PRESSED(KEY_CROUCH))
{
if(IsPublicService(GetPlayerVehicleID(playerid)) && GetPlayerVehicleSeat(playerid) == 0)
{
switch(GetPVarInt(playerid, "CopFlash"))
{
case 0:

{
KillTimer(BlinkTime[playerid]);
BlinkTime[playerid] = SetTimerEx("vBlinker", PFLASH_RATE, 1, "i", playerid);
SetPVarInt(playerid, "CopFlash", 1);

}
case 1:

{
KillTimer(BlinkTime[playerid]);
new panels, doors, lights, tires;
new carid = GetPlayerVehicleID(playerid);
GetVehicleDamageStatus(carid, panels, doors, lights, tires);
lights = encode_lights(1, 1, 1, 1);
UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
SetPVarInt(playerid, "CopFlash", 0);

}

}

}

}

if(PRESSED(KEY_LOOK_LEFT))
{
if(GetPlayerVehicleSeat(playerid) == 0)
{
if(GetPVarInt(playerid, "vBLeft") == 0)
{
KillTimer(BlinkTime[playerid]);
BlinkTime[playerid] = SetTimerEx("vBlinker", BLINK_RATE, 1, "i", playerid);
SetPVarInt(playerid, "vBLeft", 1);
SetPVarInt(playerid, "vBRight", 0);

}
else
{
KillTimer(BlinkTime[playerid]);
new panels, doors, lights, tires;
new carid = GetPlayerVehicleID(playerid);
GetVehicleDamageStatus(carid, panels, doors, lights, tires);
switch(GetPVarInt(playerid, "vMainOn"))
{
case 0:

{
lights = encode_lights(1, 1, 1, 1);

}
case 1:

{
lights = encode_lights(0, 0, 0, 0);

}

}
UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
SetPVarInt(playerid, "vBLeft", 0);

}

}

}

if(PRESSED(KEY_LOOK_RIGHT))
{
if(GetPlayerVehicleSeat(playerid) == 0)
{
if(GetPVarInt(playerid, "vBRight") == 0)
{
KillTimer(BlinkTime[playerid]);
BlinkTime[playerid] = SetTimerEx("vBlinker", BLINK_RATE, 1, "i", playerid);
SetPVarInt(playerid, "vBRight", 1);
SetPVarInt(playerid, "vBLeft", 0);

}
else
{
KillTimer(BlinkTime[playerid]);
new panels, doors, lights, tires;
new carid = GetPlayerVehicleID(playerid);
GetVehicleDamageStatus(carid, panels, doors, lights, tires);
switch(GetPVarInt(playerid, "vMainOn"))
{
case 0:

{
lights = encode_lights(1, 1, 1, 1);

}
case 1:

{
lights = encode_lights(0, 0, 0, 0);

}

}
UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
SetPVarInt(playerid, "vBRight", 0);


}

}

return 1;

}

else if(newkeys == KEY_SPRINT)
{

if(BenchPressTime[playerid] > 0)
{
PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
}
else if(BenchPresses[playerid] > 0)
{
if(BenchPresses[playerid] >= 1 && BenchPresses[playerid] <= 99 && PlayerInfo[playerid][IsUsingWeight] == 1 && IsInMovingTime[playerid] == 0)
{

PlayerInfo[playerid][pPower]+=5.000000;
TextDrawDestroy(MovingBox[playerid]);
MovingBox[playerid] = TextDrawCreate(PlayerInfo[playerid][pPower], 182.000000, "~n~");
TextDrawBackgroundColor(MovingBox[playerid], 255);
TextDrawFont(MovingBox[playerid], 1);
TextDrawLetterSize(MovingBox[playerid], 0.900000, 0.499999);
TextDrawColor(MovingBox[playerid], -1717986817);
TextDrawSetOutline(MovingBox[playerid], 0);
TextDrawSetProportional(MovingBox[playerid], 1);
TextDrawSetShadow(MovingBox[playerid], 1);
TextDrawUseBox(MovingBox[playerid], 1);
TextDrawBoxColor(MovingBox[playerid], -1);
TextDrawTextSize(MovingBox[playerid], 502.000000, 0.000000);
TextDrawShowForPlayer(playerid,MovingBox[playerid]);
if(PlayerInfo[playerid][pPower] >= 586.000000)
{
ApplyAnimation(playerid,"benchpress","gym_bp_up_A" , 4.0, 0, 0, 0, 1, 0);SetTimerEx("DownObject",2900,false,"u",playerid );
IsInMovingTime[playerid] = 1;
PlayerInfo[playerid][pReps]+=1;
TextDrawDestroy(RepsText[playerid]);
format(string,sizeof(string),"Reps: %d",PlayerInfo[playerid][pReps]);
RepsText[playerid] = TextDrawCreate(520.000000, 200.000000, string);
TextDrawBackgroundColor(RepsText[playerid], 255);
TextDrawFont(RepsText[playerid], 2);
TextDrawLetterSize(RepsText[playerid], 0.500000, 1.000000);
TextDrawColor(RepsText[playerid], -1);
TextDrawSetOutline(RepsText[playerid], 1);
TextDrawSetProportional(RepsText[playerid], 1);
TextDrawShowForPlayer(playerid,RepsText[playerid]);
}
else
{
if(BenchPresses[playerid] >= 99 && PlayerInfo[playerid][IsUsingWeight] == 1 && IsInMovingTime[playerid] == 0)
{
ApplyAnimation(playerid,"benchpress","gym_bp_getof f", 4.0, 0, 0, 1, 1, 1);SetTimerEx("GetUp",2900,false,"u",playerid);
KillTimer(ReduceTimer[playerid]);
PlayerInfo[playerid][pPower] = 506.000000;
PlayerInfo[playerid][pReps] = 0;
IsInMovingTime[playerid] = 0;
PlayerInfo[playerid][IsUsingWeight] = 0;
TextDrawHideForPlayer(playerid,RepsText[playerid]);
TextDrawHideForPlayer(playerid,Box1[playerid]);
TextDrawHideForPlayer(playerid,Box2[playerid]);
TextDrawHideForPlayer(playerid,MovingBox[playerid]);
SetCameraBehindPlayer(playerid);
SetTimerEx("BenchPressFinish", 7000, false, "i", playerid);
}
}
}
}
}
else if(newkeys & KEY_FIRE)
{
new wep = GetPlayerWeapon(playerid);
if(wep == 3
{
if(PlayerInfo[playerid][pAdmin] <= 9)
{
RemovePlayerWeaponEx(playerid, wep);
ApplyAnimationEx(playerid, "SILENCED", "Silence_reload", 3.0, 0, 0, 0, 0, 0);

}

}
else if(BenchPresses[playerid] > 0 && PlayerInfo[playerid][IsUsingWeight] == 1 && IsInMovingTime[playerid] == 0)
{

ApplyAnimation(playerid,"benchpress","gym_bp_getof f", 4.0, 0, 0, 1, 1, 1);SetTimerEx("GetUp",2900,false,"u",playerid);
KillTimer(ReduceTimer[playerid]);
PlayerInfo[playerid][pPower] = 506.000000;
PlayerInfo[playerid][pReps] = 0;
IsInMovingTime[playerid] = 0;
PlayerInfo[playerid][IsUsingWeight] = 0;
TextDrawHideForPlayer(playerid,RepsText[playerid]);
TextDrawHideForPlayer(playerid,Box1[playerid]);
TextDrawHideForPlayer(playerid,Box2[playerid]);
TextDrawHideForPlayer(playerid,MovingBox[playerid]);
SetCameraBehindPlayer(playerid);
SetTimerEx("BenchPressFinish", 7000, false, "i", playerid);
}



/* else if(newkeys == KEY_JUMP)
{
if(IsPlayerConnected(playerid))
{
if(VehAsk[playerid] == 0)
{
return 1;

}
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
{
return 1;

}
if (IsNotAEngineCar(idcar))
{
return 1;

}
if(idcar >= 135 && idcar <= 154)
{
if(HireCar[playerid] != idcar)
{
return 1;

}

}
if(idcar >= 1 && idcar <= 9)
{
if(HireCar[playerid] != idcar)
{
return 1;

}

}
if(IsAnOwnableCar(idcar))
{
if(PlayerInfo[playerid][pCarkey] == VehicleOwned[idcar])
{

}
else if(PlayerInfo[playerid][pCarkey2] == VehicleOwned[idcar])
{

}
else if(PlayerInfo[playerid][pCarkey3] == VehicleOwned[idcar])
{

}
else
{
return 1;
}

}
if(ReduceTime[playerid] > 0)
{
format(string, sizeof(string), " You need to wait %d seconds to type this command.", ReduceTime[playerid]);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;

}
GetPlayerName(playerid, sendername, sizeof(sendername));
GiveNameSpace(sendername);
if(PlayerInfo[playerid][pMaskUse] == 1)
{
format(sendername, sizeof(sendername), "[Mask_%d_38]", RandMask[playerid]);
}
if (VehicleEngine[idcar] == 0)
{
format(string, sizeof(string), "* %s spins the %s's key into the ignition and turns on the engine.", sendername, VehicleName[GetVehicleModel(idcar)-400]);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
new RandomStart;
RandomStart = random(4);
switch(RandomStart)
{
case 0,1,2:

{
if(VehAsk[playerid] == 1)
{
VehAsk[playerid] = 0;
TogglePlayerControllable(playerid,true);

}
VehicleEngine[idcar] = 1;
format(string, sizeof(string), "* %s engine starts (( %s ))", VehicleName[GetVehicleModel(idcar)-400], sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);

}
case 3:

{
format(string, sizeof(string), "* %s engine does not start (( %s ))", VehicleName[GetVehicleModel(idcar)-400], sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
ReduceTime[playerid] = 3;

}

}

}

}

}*/
else if(((oldkeys & KEY_FIRE) && !(newkeys & KEY_FIRE)) || ((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE)) || (newkeys & KEY_FIRE))
{
if(IsPlayerAiming(playerid))
{
if(GetPlayerWeapon(playerid) == 24 || GetPlayerWeapon(playerid) == 30 || GetPlayerWeapon(playerid) == 31 && GetPlayerAmmo(playerid) > 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(i == playerid) continue;
if(IsPlayerConnected(i))
{
if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
{
if(IsPlayerAimingTargetBodyPart(playerid, i, 1)) // BODY_PART_HEAD
{ DoDamage(playerid, i, 1, GetPlayerWeapon(playerid)); }
else if(IsPlayerAimingTargetBodyPart(playerid, i, 2)) // BODY_PART_TORSO
{ DoDamage(playerid, i, 2, GetPlayerWeapon(playerid)); }
else if(IsPlayerAimingTargetBodyPart(playerid, i, 3)) // BODY_PART_LEGS
{ DoDamage(playerid, i, 3, GetPlayerWeapon(playerid)); }
}
}
}
}
}
}
return 1;
}

else if(newkeys == KEY_SECONDARY_ATTACK)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(VehAsk[playerid] == 1)
{
VehAsk[playerid] = 0;
TogglePlayerControllable(playerid,true);
RemovePlayerFromVehicle(playerid);
}

}

}
return 1;
}

just add the return 1 where I did at the second last line, and try again.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)