[POMOC]ID Vozila u Poslu i Vrijeme Istovarenja

Započeo Richter, Avgust 09, 2011, 12:17:15 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

1.Pitanje
Skripta koju koristim:Moja
Detaljan opis problema:Kako da stavim da na poslu Dostavljac svaki puta kad dode na CP bude "Istovarenje Robe,Molimo Pricekajte" Kako da to napravim ?
Dio skripte: //-----------------------------Dostavljac-----------------------------------
else if(CP[playerid] == 370) { CP[playerid] = 371; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 180.1683,-145.5588,1.1548,10.0); }
else if(CP[playerid] == 371) { CP[playerid] = 372; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 185.5285,-277.3653,1.1548,10.0); }
    else if(CP[playerid] == 372) { CP[playerid] = 373; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 227.8341,-281.0205,1.1547,10.0); }
    else if(CP[playerid] == 373) { CP[playerid] = 374; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 232.0534,-224.9135,1.1607,10.0); }
    else if(CP[playerid] == 374) { CP[playerid] = 375; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 283.1018,-202.6422,1.1497,10.0); }
    else if(CP[playerid] == 375) { CP[playerid] = 376; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 282.6877,-144.9557,1.1571,10.0); }
    else if(CP[playerid] == 376) { CP[playerid] = 377; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 318.8651,-141.9424,1.1521,10.0); }
    else if(CP[playerid] == 377) { CP[playerid] = 378; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 332.2780,-79.0684,1.1502,10.0); }
    else if(CP[playerid] == 378) { CP[playerid] = 379; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 137.7248,-74.1467,1.1548,10.0); }
    else if(CP[playerid] == 379) { CP[playerid] = 380; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 132.5785,-164.0952,1.1561,10.0); }
else if(CP[playerid] == 380) { CP[playerid] = 381; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 94.0623,-165.2614,2.3188,10.0); }
else if(CP[playerid] == 381)
{
CP[playerid] = 0;
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, COLOR_LIGHTRED, "Zavrsio si Dostavljenje, i zaradio 300 $ ");
RemovePlayerFromVehicle(playerid);
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
GivePlayerMoney(playerid, 300);
}

Neke slike/video za lakse dobivanje pomoci(neobavezno):


2.Pitanje
Skripta koju koristim:Moja
Detaljan opis problema:Kako da stavim Da moras biti u Vozilu odredenog IDa (ne id auta Sultan = 560,nego ID po redu od kojeg je stvoren)
Dio skripte:
if(strcmp(cmd, "/dostavi", true) == 0)
{
  if(IsPlayerConnected(playerid))
  {
       if(PlayerInfo[playerid][pJob] == 18)
      {
                   if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_YELLOW2, "Moras biti u vozilu Dostavljaca da bi Zapoceo Posao");
                   SendClientMessage(playerid, COLOR_GREEN, " Sef: Tvoje radno vrijeme je Udi u Dostavljarsko vozilo i dostavljaj! !");
SetPlayerCheckpoint(giveplayerid, 141.6081,-141.8523,1.1494,5.0);
CP[giveplayerid] = 370;
}
}
  return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno):
Poslednja Izmena: Avgust 09, 2011, 12:17:59 POSLE PODNE od [CZ]Jan_Richter

PRVI PROBLEM



else if(CP[playerid] == 370) { CP[playerid] = 371; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 180.1683,-145.5588,1.1548,10.0); }

Zameni sa ovim: else if(CP[playerid] == 370) { CP[playerid] = 371; DisablePlayerCheckpoint(playerid); SendClientMessage(playerid, COLOR_WHITE, "Istovaranje.. cekaj!"); TogglePlayerControllable(playerid, 0); SetTimerEx("OsveziIgraca", VRME_U_MS, false, "i", playerid); SetPlayerCheckpoint(playerid, 180.1683,-145.5588,1.1548,10.0); }


forward OsveziIgraca(playerid);



public OsveziIgraca(playerid)
{
TogglePlayerControllable(playerid, 1);
}



DRUGI PROBLEM



Najbolje ti je kada kreiras vozilo, da njegov ID odmah smestiš u neku promenjivu. Naprimer:
new VozilaZaKurvara[BROJ_VOZILA_ZA_POSAO];

I onda kada kreiraš:
VozilaZaKuvara[0] = AddStaticVehicleEx();
VozilaZaKuvara[1] = AddStaticVehicleEx();

Itd ...

I onda:
forward KuvarskoVozilo(carid);

public(KuvarskoVozilo(carid))
{
for(new i = 0; i < BROJ_VOZILA_ZA_KUVARA; i++)
{
if(VoziloZaKuvara == carid)   return 1;
}
}







NAPOMENA: Nije testirano, ako ne radi, javi. :)
Poslednja Izmena: Avgust 09, 2011, 13:22:36 POSLE PODNE od mikec