[POMOC]OnPlayerKeyStateChange

Započeo Belajac, Decembar 12, 2012, 17:39:37 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: CLRP
Detaljan opis problema: Blokira pawno i moram Don't Sent
Deo Skripte:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    new string[128];
new sendername[MAX_PLAYER_NAME];
new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));
new newcar = GetPlayerVehicleID(playerid);
//ZA BRISANJE
/*    format(string, sizeof(string), "--| Key: %d", newkeys );
    SendClientMessage(playerid,YELLOW, string);*/
//ZA BRISANJE
if(newkeys == KEY_JUMP)//128
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
if(IsPlayerConnected(playerid))
{
if(!engineOn[GetPlayerVehicleID(playerid)])
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
if(IsAnOwnableCar(newcar))
{
     if(PlayerInfo[playerid][pAutoKljuc1] == newcar) { }
else if(PlayerInfo[playerid][pAutoKljuc2] == newcar) { }
else if(PlayerInfo[playerid][pAutoKljuc3] == newcar) { }
else if(PlayerInfo[playerid][pAutoKljuc4] == newcar) { }
else if(PlayerInfo[playerid][pAutoKljuc5] == newcar) { }
else { return 1; }
}
if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509)
{
return 1;
}
if(newcar == 59 || newcar == 60)
{
return 1;
}
if(newcar >= 135 && newcar <= 154)
{
    if(HireCar[playerid] != newcar)
    {
return 1;
}
}
if(IsARibar(newcar))
{
    return 1;
}
if(AvioniVozila(newcar))
{
return 1;
}
if(CistaculicaVozila(newcar))
{
return 1;
}
if(gEngine[playerid] == 1) { return 1; }

JBC_PutPlayerInVehicle(playerid, newcar, 0);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s okrece kljuc i pokusava da upali motor.", sendername);
ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetTimerEx("StartingTheVehicle",3500,0,"i",playerid);
GameTextForPlayer(playerid, "~w~Startovanje motora...",3500,3);
gEngine[playerid] = 1;
return 1;
}
}
}
return 1;
    }

    else if(newkeys == KEY_CROUCH)//128 <------ODAVDE
    {
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        return 1;
    }
         if (PlayerToPoint(15.0, playerid,1864.09997559,2009.00000000,8.99999905))
{
            if(PlayerInfo[playerid][pLeader] == 17 || PlayerInfo[playerid][pMember] == 17)
            {
                MoveObject(etakapija,1864.09997559,2009.00000000,-8.99999905,2.00);
                SetTimer("GateClose31", 12000, 0);
             }
             }
            if (PlayerToPoint(15.0, playerid,-1741.30004883,28.60000038,4.30000019))
{
            if(PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 5)
   {
                MoveObject(yamakapija,-1741.30004883,28.60000038,4.30000019,2.00);
                SetTimer("GateClose32", 12000, 0);
                }
                }
            if (PlayerToPoint(15.0, playerid,-1845.00000000,-226.60000610,19.10000038))
{
            if(PlayerInfo[playerid][pLeader] == 18 || PlayerInfo[playerid][pMember] == 18)
{
                MoveObject(ruskapija,-1845.00000000,-226.60000610,19.10000038,2.00);
                SetTimer("GateClose33", 12000, 0);
                }
                }
             if (PlayerToPoint(15.0, playerid,-2126.30004883,-80.59999847,37.00000000))
{
            if(PlayerInfo[playerid][pLeader] == 18 || PlayerInfo[playerid][pMember] == 6)
            {
                MoveObject(lcnkapija,-2126.30004883,-80.59999847,-10.00000000,2.00);
                MoveObject(lcnkapija2,-2128.39990234,-80.40000153,-10.00000000,2.00);
                SetTimer("GateClose34", 12000, 0);
                }
                }
                 }
    return 1;
}
Poslednja Izmena: Decembar 12, 2012, 17:41:03 POSLE PODNE od Belajac

vidis te zagradice tu si ti otvorene i zatvorene preborji svake od tih jer moras imat jednak broj otvorenih i zatvorenih zagrada recimo zatvorenih imas 34 a otvoreni 45 znaci to ce ti izbacivati jer nisu jednak broj prebroji otvorene i zatvorene i vidi fali ti zagrada

ovo je zatvorena

{

a ovo otvorena

}

znaci preboji prvo zatvorene sve i onda zapisi si negdje koliko njih ima pa onda otvorene zapamti jednak broj zagrada uvijek, nadam se da sam ti pomogao :)

Nije, zgrade su okej pogledajte i vi:
else if(newkeys == KEY_CROUCH)//128
    {
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        return 1;
    }
         if (PlayerToPoint(15.0, playerid,1864.09997559,2009.00000000,8.99999905))
{
            if(PlayerInfo[playerid][pLeader] == 17 || PlayerInfo[playerid][pMember] == 17)
            {
                MoveObject(etakapija,1864.09997559,2009.00000000,-8.99999905,2.00);
                SetTimer("GateClose31", 12000, 0);
             }
             }
            if (PlayerToPoint(15.0, playerid,-1741.30004883,28.60000038,4.30000019))
{
            if(PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 5)
   {
                MoveObject(yamakapija,-1741.30004883,28.60000038,4.30000019,2.00);
                SetTimer("GateClose32", 12000, 0);
                }
                }
            if (PlayerToPoint(15.0, playerid,-1845.00000000,-226.60000610,19.10000038))
{
            if(PlayerInfo[playerid][pLeader] == 18 || PlayerInfo[playerid][pMember] == 18)
{
                MoveObject(ruskapija,-1845.00000000,-226.60000610,19.10000038,2.00);
                SetTimer("GateClose33", 12000, 0);
                }
                }
             if (PlayerToPoint(15.0, playerid,-2126.30004883,-80.59999847,37.00000000))
{
            if(PlayerInfo[playerid][pLeader] == 18 || PlayerInfo[playerid][pMember] == 6)
            {
                MoveObject(lcnkapija,-2126.30004883,-80.59999847,-10.00000000,2.00);
                MoveObject(lcnkapija2,-2128.39990234,-80.40000153,-10.00000000,2.00);
                SetTimer("GateClose34", 12000, 0);
                }
                }
                 }
    return 1;
}

to ti jedni moze izbacit ako nemas jednak broj zagrada morasm vidjet nemos rec nije zagrade to ti u recimo oko 97 posto je do zagrada izbacuje ti to ne moze ti drugo nista bit znam i siguran sam jer sam imao ja toga dosta u 3 god tako da znam da ti je do toga :)