Question
#1

I have one problem with OnPlayerStateChange.. I made seatbelt/helmet system but the problem is when player fall from bike it says "you have unbuckled your seatbelt" it should say "you removed safety helmet"... - this was when code was OnPlayerExitVehicle

Now I moved code OnPlayerStateChange and it won't even say that I removed my helmet when I go off the bike..
All I want to do is when player fall off the bike it should say that player removed safety helmet.

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{

    new string[256];
    new sendername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    new vehicleid = GetPlayerVehicleID(playerid);

    if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_EXIT_VEHICLE)
    {
        if(SeatBelt[playerid] == 1)
        {
            if(IsModelABike(vehicleid)) // Bike - helmet
            {
                SeatBelt[playerid] = 0;
                if(IsPlayerAttachedObjectSlotUsed(playerid, 1)) RemovePlayerAttachedObject(playerid, helmet[0]); // Removing his helmet
                if (Masked[playerid] == 1) format(string, sizeof(string), "*Stranger_%d removes the safety helmet.", maskid[playerid]);
                else format(string, sizeof(string), "*%s removes the safety helmet.", sendername);
                ProxDetector(8.0, playerid, string,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA);
                return 1;
            }
            else // SEATBELT
            {
                SeatBelt[playerid] = 0;
                if (Masked[playerid] == 1) format(string, sizeof(string), "*Stranger_%d unbuckles his seatbelt.", maskid[playerid]);
                else format(string, sizeof(string), "*%s unbuckles his seatbelt.", sendername);
                ProxDetector(8.0, playerid, string,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA);
            }
        }
    }
Reply


Messages In This Thread
Question - by Lajko1 - 03.08.2014, 10:16
Re: Question - by KayJ - 03.08.2014, 10:20
Re: Question - by McBan - 03.08.2014, 10:43
Re: Question - by Lajko1 - 03.08.2014, 10:47
Re: Question - by McBan - 03.08.2014, 11:00
Re: Question - by Threshold - 03.08.2014, 11:10
Re: Question - by Lajko1 - 03.08.2014, 12:35
Re: Question - by Threshold - 03.08.2014, 15:03
Re: Question - by Lajko1 - 03.08.2014, 15:35
Re: Question - by ViniBorn - 03.08.2014, 16:28

Forum Jump:


Users browsing this thread: 2 Guest(s)