[Pomoc] Palenje auta (SHIFT)

Započeo DeBlack, Oktobar 03, 2011, 10:45:01 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: street stories
Detaljan opis problema: Pa naravio sam komandu kada stisnem SHIFT da se upali auto i radi mi, ali kada ga ponovno stisnem NECE da se ugasi a napravio sam to, i nezz gdje je tu greska... Evo dol dio skripte pa et ako neko zna nek pomogne:
Dio skripte:

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
   new string[128];
new sendername[MAX_PLAYER_NAME];
new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));
new newcar = GetPlayerVehicleID(playerid);
   if(newkeys == KEY_JUMP)
   {
       if(IsPlayerInAnyVehicle(playerid))
       {
if(IsPlayerConnected(playerid))
{
if(!engineOn[GetPlayerVehicleID(playerid)])
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
if(IsAnOwnableCar(newcar))
{
   if(PlayerInfo[playerid][pPcarkey] == newcar) { }
else if(PlayerInfo[playerid][pPcarkey2] == newcar) { }
else if(PlayerInfo[playerid][pPcarkey3] == 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(IsAHarvest(newcar))
{
   return 1;
}
if(IsADrugHarvest(newcar))
{
   return 1;
}
if(IsAPlane(newcar))
{
return 1;
}
if(IsASweeper(newcar))
{
return 1;
}
if(gEngine[playerid] == 1) { return 1; }

PutPlayerInVehicle(playerid, newcar, 0);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s pali motor vozila.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                   engineOn[GetPlayerVehicleID(playerid)] = true;
                   TogglePlayerControllable(playerid, true);
gEngine[playerid] = true;
return 1;
}
}
}
   }
   else if(newkeys == KEY_SECONDARY_ATTACK)
   {

       if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
       {
           if(gEngine[playerid] == 0 && engineOn[newcar] == 0)
           {
RemovePlayerFromVehicle(playerid);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s gasi motor vozila.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
               engineOn[GetPlayerVehicleID(playerid)] = false;
TogglePlayerControllable(playerid, false);
return 1;
           }
           else if(NoFuel[playerid] == 1)
{
   TogglePlayerControllable(playerid, false);
RemovePlayerFromVehicle(playerid);
NoFuel[playerid] = 0;
return 1;
}
       }
   }


EDIT: I u komandu /engine kada upalim auto radi, a kada ga ugasim i izadjem iz vozila igrac mi ostane freeze... Moram se stalno /unfreeze, evo dio skripte:

if(!strcmp(cmd, "/engine", true))
{
    if(IsPlayerConnected(playerid))
    {
if(IsPlayerInAnyVehicle(playerid))
{
    if(!engineOn[GetPlayerVehicleID(playerid)])
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
if(gEngine[playerid] == 1) { return 1; }

new playerveh = GetPlayerVehicleID(playerid);
PutPlayerInVehicle(playerid, playerveh, 0);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pali motor vozila.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    engineOn[GetPlayerVehicleID(playerid)] = true;
                    TogglePlayerControllable(playerid, true);
gEngine[playerid] = 1;
return 1;
}
if(engineOn[GetPlayerVehicleID(playerid)])
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
if(IsAPlane(idcar))
{
    return 1;
}
engineOn[GetPlayerVehicleID(playerid)] = false;
TogglePlayerControllable(playerid, false);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s gasi motor vozila.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
gEngine[playerid] = 0;
return 1;
}
}
    }
    return 1;
}


Neke slike/video za lakse dobivanje pomoci(neobavezno):
Poslednja Izmena: Oktobar 03, 2011, 10:55:15 PRE PODNE od DeBlack
      
DeBlack | Mapper | PS User

Ja mislim da ti je do ovoga:

    else if(newkeys == KEY_SECONDARY_ATTACK)

Umjesto toga stavi:

    else if(newkeys == KEY_JUMP)

Vidi pa mi javi. Pocetnik sam u skriptanju pa nisam siguran :D

Nevelja... Sada sam opet vratio da se gasi sa CTRL ali kada ga ugasim on STANE i nmg nista ali mi uopce nepise * %s gasi motor vozila.   I nmg ga upalit sve dok opet CTRL nestisnem, ALI NISTA NEPISE -.-" .... Znal neko? I ovo za /engine zasto me freeze-a kad ugasim i izadjem?
      
DeBlack | Mapper | PS User