Jump to content

Kubko

Uživatel
  • Příspěvků

    257
  • Registrován

  • Aktivní

  • Vítězných dnů

    3

Everything posted by Kubko

  1. Vymazal si ten OnPlayerStateChange kód?
  2. Neviem, či to pôjde neskúšal som. public OnPlayerExitVehicle(playerid, vehicleid) { if (vehicleid == LetadloNPC) { Kick(ZiskajIDzMena("Pilot")); SetVehicleToRespawn(LetadloNPC); } return 1; } ZiskajIDzMena(const string[]) { new meno[MAX_PLAYER_NAME]; for (new i; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { GetPlayerName(i, meno, sizeof (meno)); if (!strcmp(meno, string)) { return i; } } } }
  3. Neviem, čo robí ten public "Heslo".
  4. new bool:LietadloObsadene[MAX_PLAYERS]; public OnPlayerUpdate(playerid) { if (IsPlayerInVehicle(playerid,LetadloNPC) && !LietadloObsadene[playerid]) { if (GetPlayerVehicleSeat(playerid) == 1) { LietadloObsadene[playerid] = true; ConnectNPC("Pilot","mynpc"); } } return 1; } public OnPlayerSpawn(playerid) { if(IsPlayerNPC(playerid)) { new npcname[MAX_PLAYER_NAME]; GetPlayerName(playerid, npcname, sizeof(npcname)); if(!strcmp(npcname, "Pilot", true)) { PutPlayerInVehicle(playerid, LetadloNPC, 0); } return 1; } return 1; } public OnPlayerExitVehicle(playerid, vehicleid) { if (vehicleid == LetadloNPC) { if (LietadloObsadene[playerid]) { LietadloObsadene[playerid] = false; } } return 1; }
  5. Vypni a zapni server, niekedy ak dávaš "gmx" tak sa mi stávalo, že mi tam písalo blocking connection a až po nejaký čas ma pripojilo. Daj "exit" a reštartuj.
  6. S týmto bohužiaľ nespravíš nič, si zrejme príliš ďaleko od mapy GTA.
  7. Hm, tak skús takto: new LietadloNPC; public OnGameModeInit() { LietadloNPC = CreateVehicle(...); return 1; } public OnPlayerUpdate(playerid) { if (IsPlayerInVehicle(playerid, LietadloNPC)) { if (GetPlayerVehicleSeat(playerid) == 1) { ConnectNPC(...); SendClientMessage(playerid, -1, "NPC sa má pripojiť"); } } return 1; }
  8. new LietadloNPC; public OnGameModeInit() { LietadloNPC = CreateVehicle(...); return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { if (newstate == PLAYER_STATE_ENTER_VEHICLE_PASSENGER) { if (IsPlayerInVehicle(playerid, LietadloNPC) { ConnectNPC(...); SendClientMessage(playerid, -1, "NPC sa má pripojiť"); } } return 1; } Uprav si to, resp. stačí keď si prekopíruješ ten SendClientMessage do toho tvojho kódu a vyskúšaj nasadnúť do toho lietadla.
  9. Tak vyskúšaj malý debug: public OnPlayerConnect(playerid) { new meno[MAX_PLAYER_NAME]; GetPlayerName(playerid, meno, sizeof (meno)); printf("Pripojil sa hráč %s, ID = %d", meno, playerid); return 1; } Vypíše ti, že sa to NPC napojí? (konzola)
  10. new bool:PortPovoleny, PortSuradnice[3]; public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/prikaz", cmdtext)) { if (PortPovoleny) { //Ak je zapnutý port SetPlayerPos(playerid, PortSuradnice[0], PortSuradnice[1], PortSuradnice[2]); } else { SendClientMessage(playerid, -1, "Port je vypnutý!"); } return 1; } if (!strcmp("/portovladanie", cmdtext)) { if (!PortPovoleny) { PortPovoleny = true; } else { PortPovoleny = false; } return 1; } if (!strcmp("/nastavport", cmdtext)) { GetPlayerPos(playerid, PortSuradnice[0], PortSuradnice[1], PortSuradnice[2]); return 1; } return 0; }
  11. Nechápem čo chceš, ale určite by to šlo. Aha, ak ich chceš odportovať tak: new bool:PortPovoleny; public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/prikaz", cmdtext)) { if (PortPovoleny) { //Ak je zapnutý port SetPlayerPos(playerid, /* zmeň si súradnice */); } else { SendClientMessage(playerid, -1, "Port je vypnutý!"); } return 1; } if (!strcmp("/portovladanie", cmdtext)) { if (!PortPovoleny) { PortPovoleny = true; } else { PortPovoleny = false; } return 1; } return 0; }
  12. Ale urobí. Otvoríš port ak je vypnutý, alebo ho vypneš. daj /portovladanie a potom /prikaz, potom znova /portovladanie a potom /prikaz a u uvidíš. // podmienka ? je splnená : nie je splnená
  13. Máš niečo v OnPlayerConnect || OnPlayerSpawn, alebo máš v server.cfg nastavený počet NPC?
  14. Môže to byť spôsobené viacerými vecami, napríklad registrácia.
  15. Kubko

    hledám Hru na Android

    Asphalt 8 Airborne, Nova 3, teraz som si stiahol aj The Amazing Spiderman 2, celkom pecka. Tiež vyšlo GTA San Andreas na mobil, ale nehral som to veľmi, je to to isté ako na PC.
  16. Nj, môžeš použiť ternárny operátor, ale ak si začiatočník, najprv sa nauč if a else.
  17. Riešenie č. 1 - y_cmd (+ cyklus asi) Riešenie č. 2 - new bool:PortPovoleny; public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/prikaz", cmdtext)) { if (PortPovoleny) { //Ak je zapnutý port } else { SendClientMessage(playerid, -1, "Port je vypnutý!"); } return 1; } if (!strcmp("/portovladanie", cmdtext)) { if (!PortPovoleny) { PortPovoleny = true; } else { PortPovoleny = false; } return 1; } return 0; }
  18. No áno, ale to je nahrávka pre lietadlo AT-400.
  19. Vieš vôbec, ako sa také NPC vytvára? Je samozrejmé, že nemôžeš použiť AT-400 nahrávku, keď máš nejaké iné lietadlo. Najprv si musíš tú trasu nahrať, je na to filterscript myslím.
  20. Ja som ho práveže hral, ale ani ja netuším o čom je reč.
  21. Čo? Nepochopil som ti asi, ale ak chceš spraviť príkaz tak: public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/kangoroo", cmdtext)) { return 1; } return 0; }
  22. //Všetko sa dá, napadá ma toto: new LietadloNPC; public OnGameModeInit() { LietadloNPC = CreateVehicle(...); return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { if (newstate == PLAYER_STATE_ENTER_VEHICLE_PASSENGER) { if (IsPlayerInVehicle(playerid, LietadloNPC) { ConnectNPC(...); //Nasadol ako pasažier do lietadla } } return 1; }
×
×
  • Create New...