SpyLine 0 Odesláno: 24. Prosinec, 2013 Share Odesláno: 24. Prosinec, 2013 Zdravím, dnes jsem si dělal do gamemodu lock system na principu, že když zmáčknete tlačítko, zamkne se auto. Jenže se nic nestane, ani GmTxt se nenapíše.. Code zde: if(newkeys == KEY_SUBMISSION) { if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { if(CarLocked{GetPlayerVehicleID(playerid)} == 0) { for(new i=0; i < MAX_PLAYERS; i++) { if(i == playerid) continue; SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,1); } CarLocked{GetPlayerVehicleID(playerid)} = 1; GameTextForPlayer(playerid, "ZAMKNUTO", 3000, 3); }else{ for(new i=0; i < MAX_PLAYERS; i++) { SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,0); } CarLocked{GetPlayerVehicleID(playerid)} = 0; GameTextForPlayer(playerid, "ODEMKNUTO", 3000, 3); } } } Budu rád za každou pomoc. Link to comment Share on other sites More sharing options...
0 play 0 Odesláno: 24. Prosinec, 2013 Share Odesláno: 24. Prosinec, 2013 (upraveno) Snad toto if(newkeys == KEY_SUBMISSION) { if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { if(CarLocked[GetPlayerVehicleID(playerid)] == 0) { for(new i=0; i < MAX_PLAYERS; i++) { if(i == playerid) { SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,1); CarLocked[GetPlayerVehicleID(playerid)] = 1; GameTextForPlayer(playerid, "ZAMKNUTO", 3000, 3); } } }else{ for(new i=0; i < MAX_PLAYERS; i++) { if(i == playerid) { SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,0); CarLocked[GetPlayerVehicleID(playerid)] = 0; GameTextForPlayer(playerid, "ODEMKNUTO", 3000, 3); } } } } } Edited 24. Prosinec, 2013 by play Link to comment Share on other sites More sharing options...
0 SpyLine 0 Odesláno: 24. Prosinec, 2013 Author Share Odesláno: 24. Prosinec, 2013 Super .. Thx. Link to comment Share on other sites More sharing options...
0 play 0 Odesláno: 24. Prosinec, 2013 Share Odesláno: 24. Prosinec, 2013 Super .. Thx. promiň takto if(newkeys == KEY_SUBMISSION) { if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { if(CarLocked[GetPlayerVehicleID(playerid)] == 0) { for(new i=0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,1); CarLocked[GetPlayerVehicleID(playerid)] = 1; GameTextForPlayer(playerid, "ZAMKNUTO", 3000, 3); } } }else{ for(new i=0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,0); CarLocked[GetPlayerVehicleID(playerid)] = 0; GameTextForPlayer(playerid, "ODEMKNUTO", 3000, 3); } } } } } Link to comment Share on other sites More sharing options...
0 SpyLine 0 Odesláno: 24. Prosinec, 2013 Author Share Odesláno: 24. Prosinec, 2013 Fungovalo to i tak, jak to bylo minule. Díky:) Link to comment Share on other sites More sharing options...
0 play 0 Odesláno: 24. Prosinec, 2013 Share Odesláno: 24. Prosinec, 2013 nn nepujde zamkne se to jen tobě uprav to jak jsem to poslal po druhé jak si tam mě if(i == playerid) tak to zamkne jen pro tvoje id musí tam být if(IsPlayerConnected(i)) Link to comment Share on other sites More sharing options...
0 SpyLine 0 Odesláno: 24. Prosinec, 2013 Author Share Odesláno: 24. Prosinec, 2013 Ok dík Ještě potřebuju poradit jak udělat to, aby se odemklo po respawnu. Poradíš? Link to comment Share on other sites More sharing options...
0 play 0 Odesláno: 24. Prosinec, 2013 Share Odesláno: 24. Prosinec, 2013 jj toto si radši ještě uprav: if(newkeys == KEY_SUBMISSION) { if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { if(CarLocked[GetPlayerVehicleID(playerid)] == 0) { SetVehicleParamsEx(GetPlayerVehicleID(playerid),0,0,0,1,0,0,0); CarLocked[GetPlayerVehicleID(playerid)] = 1; GameTextForPlayer(playerid, "ZAMKNUTO", 3000, 3); }else{ SetVehicleParamsEx(GetPlayerVehicleID(playerid),0,0,0,0,0,0,0); CarLocked[GetPlayerVehicleID(playerid)] = 0; GameTextForPlayer(playerid, "ODEMKNUTO", 3000, 3); } } } OnVehicleSpawn a OnVehicleDeath SetVehicleParamsEx(vehicleid,0,0,0,0,0,0,0); CarLocked[vehicleid] = 0; Link to comment Share on other sites More sharing options...
0 SpyLine 0 Odesláno: 24. Prosinec, 2013 Author Share Odesláno: 24. Prosinec, 2013 A ještě otázka, chci zamknout nějaké auto na mapě tak, že bude jen pro admina ... Víš jak? Link to comment Share on other sites More sharing options...
0 Amenadiel 286 Odesláno: 24. Prosinec, 2013 Share Odesláno: 24. Prosinec, 2013 A ještě otázka, chci zamknout nějaké auto na mapě tak, že bude jen pro admina ... Víš jak? Jak pro admina ? jen pro jednoho nebo pro všechny ? Link to comment Share on other sites More sharing options...
0 SpyLine 0 Odesláno: 24. Prosinec, 2013 Author Share Odesláno: 24. Prosinec, 2013 Pro all Link to comment Share on other sites More sharing options...
0 Amenadiel 286 Odesláno: 24. Prosinec, 2013 Share Odesláno: 24. Prosinec, 2013 Pro all tak si najdi public OnPlayerEnterVehicle a dej si tam podmínku jake je to ID auta (Lepší si je udělat nato promenu) . . . A když se náš člen pawna Play cítí být tak užasnej on ti to dovysvetlí Link to comment Share on other sites More sharing options...
0 SpyLine 0 Odesláno: 24. Prosinec, 2013 Author Share Odesláno: 24. Prosinec, 2013 Díky já jsem to pochopil Link to comment Share on other sites More sharing options...
0 play 0 Odesláno: 24. Prosinec, 2013 Share Odesláno: 24. Prosinec, 2013 ano zajisté když to wilszon neví musíš vytvořit auto Nahoru do módu new AdminAuto; do OnGameModeInit AdminAuto = CreateVehicle(id,x,y,z,rotace,barva1.barva2,respawn_delay); SetVehicleParamsEx(AdminAuto,0,0,0,1,0,0,0); do OnPlayerSpawn if("Proměnná pro admina" > 0){ SetVehicleParamsForPlayer(AdminAuto,playerid,0,0); } do OnPlayerDisconnect SetVehicleParamsForPlayer(AdminAuto,playerid,0,1); Link to comment Share on other sites More sharing options...
0 Amenadiel 286 Odesláno: 24. Prosinec, 2013 Share Odesláno: 24. Prosinec, 2013 ano zajisté když to wilszon neví musíš vytvořit auto Nahoru do módu new AdminAuto; do OnGameModeInit AdminAuto = CreateVehicle(id,x,y,z,rotace,barva1.barva2,respawn_delay); SetVehicleParamsEx(AdminAuto,0,0,0,1,0,0,0); do OnPlayerSpawn if("Proměnná pro admina" > 0){ SetVehicleParamsForPlayer(AdminAuto,playerid,0,0); } do OnPlayerDisconnect SetVehicleParamsForPlayer(AdminAuto,playerid,0,1); Ok je videt že jsi uplnej dement chtel to pro adminy tak uvidíš alespon kod píšu z hlavy ne z wikini new CD; // Promena na to tvé Auto public OnGameModeInit() { CD = AddStaticVehicleEx(Auto,Float:X,Float:Z,Float:Y,Color1,Color2,ResPawnTime); // do romeny CD si zapíšem tohle vehicle return 1; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if(vehicleid == CD)// Pokud se Vehicle do ktereho vstupuje rovná ID CD ktere jsi si udělal tak se stane toto { if(IsPlayerAdmin(playerid)) // pokud je admin stane se { SendClientMessage(playerid,-1,"Vítej Admine! Vstupuješ do Admin Auta!"); }else{ // pokud není admin napíše mu zpravu že není admin a vyhodí ho z auta SendClientMessage(playerid,-1,"Nejsi Admin !"); RemovePlayerFromVehicle(playerid); } } return 1; } a Play už mě docela sereš jakej si myslíš že jsi namachrovanej debílek . .. Link to comment Share on other sites More sharing options...
0 SpyLine 0 Odesláno: 24. Prosinec, 2013 Author Share Odesláno: 24. Prosinec, 2013 Říkal jsem že to vím, ale díky Link to comment Share on other sites More sharing options...
0 Amenadiel 286 Odesláno: 24. Prosinec, 2013 Share Odesláno: 24. Prosinec, 2013 Říkal jsem že to vím, ale díky Já se od tohodle dementa co skoro nic neumí nenechám urážet Link to comment Share on other sites More sharing options...
0 SpyLine 0 Odesláno: 24. Prosinec, 2013 Author Share Odesláno: 24. Prosinec, 2013 Ještě tu je problém s tím, že když zamknu auto, tak i pro sebe. Link to comment Share on other sites More sharing options...
0 play 0 Odesláno: 24. Prosinec, 2013 Share Odesláno: 24. Prosinec, 2013 if(newkeys == KEY_SUBMISSION) { if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { if(CarLocked[GetPlayerVehicleID(playerid)] == 0) { SetVehicleParamsEx(GetPlayerVehicleID(playerid),0,0,0,1,0,0,0); SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),playerid,0,0); CarLocked[GetPlayerVehicleID(playerid)] = 1; GameTextForPlayer(playerid, "ZAMKNUTO", 3000, 3); }else{ SetVehicleParamsEx(GetPlayerVehicleID(playerid),0,0,0,0,0,0,0); CarLocked[GetPlayerVehicleID(playerid)] = 0; GameTextForPlayer(playerid, "ODEMKNUTO", 3000, 3); } } } wilszon35 já to měl taky pro admini ale ne to že ho to s auta vyhodí ale že je zamlklé taky si podle mého postupu může nastavit alarm Link to comment Share on other sites More sharing options...
0 SpyLine 0 Odesláno: 24. Prosinec, 2013 Author Share Odesláno: 24. Prosinec, 2013 Ještě k Admin car, když tam nastoupím, vyskočí dialog že ji nemůžu řídit, ale úplně v pohodě to jde .... Co s tím? Mám to přesně jak to psal wili A vypne se mi motor když zamknu caru .... jak to mám opravit? Link to comment Share on other sites More sharing options...
0 play 0 Odesláno: 24. Prosinec, 2013 Share Odesláno: 24. Prosinec, 2013 pro to admin auto chybí ti tam RemovePlayerFromVehicle(playerid); a pro motor if(newkeys == KEY_SUBMISSION) { if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new p1,p2,p3,p4,p5,p6,p7; GetVehicleParamsEx(GetPlayerVehicleID(playerid),p1,p2,p3,p4,p5,p6,p7); if(CarLocked[GetPlayerVehicleID(playerid)] == 0) { SetVehicleParamsEx(GetPlayerVehicleID(playerid),p1,p2,p3,1,p5,p6,p7); SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),playerid,0,0); CarLocked[GetPlayerVehicleID(playerid)] = 1; GameTextForPlayer(playerid, "ZAMKNUTO", 3000, 3); }else{ SetVehicleParamsEx(GetPlayerVehicleID(playerid),p1,p2,p3,0,p5,p6,p7); CarLocked[GetPlayerVehicleID(playerid)] = 0; GameTextForPlayer(playerid, "ODEMKNUTO", 3000, 3); } } } ok snad už naposled promiň Link to comment Share on other sites More sharing options...
0 SpyLine 0 Odesláno: 24. Prosinec, 2013 Author Share Odesláno: 24. Prosinec, 2013 To RemovePlayerFromVehicle(playerid); tam mám... Takže co teď? public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if(vehicleid == admincar) { if(IsPlayerAdmin(playerid)) { // adm text }else{ ShowPlayerDialog(playerid,785,DIALOG_STYLE_MSGBOX,"Admin Car","Toto je Admin Car, talže jí nemůžete řídit (pouze pro Administrátory).","OK",""); RemovePlayerFromVehicle(playerid); } } return 1; } Link to comment Share on other sites More sharing options...
0 play 0 Odesláno: 24. Prosinec, 2013 Share Odesláno: 24. Prosinec, 2013 Máš to správně tak to nvm zkus to prohodit RemovePlayerFromVehicle(playerid); ShowPlayerDialog(playerid,785,DIALOG_STYLE_MSGBOX,"Admin Car","Toto je Admin Car, talže jí nemůžete řídit (pouze pro Administrátory).","OK",""); Chybu tam nemáš mělo by to jít Link to comment Share on other sites More sharing options...
0 SpyLine 0 Odesláno: 24. Prosinec, 2013 Author Share Odesláno: 24. Prosinec, 2013 Jak by jsi to udělal ty aby ho to tam vůbec nepustilo? Link to comment Share on other sites More sharing options...
0 Tanga 131 Odesláno: 24. Prosinec, 2013 Share Odesláno: 24. Prosinec, 2013 if(newkeys == KEY_SUBMISSION) { if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { if(CarLocked[GetPlayerVehicleID(playerid)] == 0) { SetVehicleParamsEx(GetPlayerVehicleID(playerid),0,0,0,1,0,0,0); SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),playerid,0,0); CarLocked[GetPlayerVehicleID(playerid)] = 1; GameTextForPlayer(playerid, "ZAMKNUTO", 3000, 3); }else{ SetVehicleParamsEx(GetPlayerVehicleID(playerid),0,0,0,0,0,0,0); CarLocked[GetPlayerVehicleID(playerid)] = 0; GameTextForPlayer(playerid, "ODEMKNUTO", 3000, 3); } } } wilszon35 já to měl taky pro admini ale ne to že ho to s auta vyhodí ale že je zamlklé taky si podle mého postupu může nastavit alarm -- Použiješ hacking engine a stlačíš HOME a portne ťa do auta. Resp. nastavíš odomknutie všetkých áut v okolí a má to rovnaký efekt. Wilson to odstránenie z vozidla tiež nie je nepreistrelné. Funguje len to, že hráča portneš na jeho súradnice a tým ho vyhodíš z auta. Totiž ak je tam remove, tak po opakovanom stláčaní HOME ak ti necrashla hra, tak si v aute v pohode mohol odísť. newkeys == KEY_SUBMISSION // Zlý tvar. Pozri si návod na wiki. Link to comment Share on other sites More sharing options...
0 play 0 Odesláno: 25. Prosinec, 2013 Share Odesláno: 25. Prosinec, 2013 Tango: chtěl opravit zamykaní a odemykání aut to se mi po "pár" pokusech povedlo :-) co se týče toho admin auta tak to bych taky jednoduše zamlkl a dal jen podmínku public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger){ if(vehicleid == admincar) { if("Proměnná pro admina" == 0){ Kick(playerid); } } return 1; } Samozřejmě trochu upravit nějaké varování,odpočet. a ještě ve hře bude určitě vypadat líp zamknuté auto než aby ho to teleportovalo vedle auta Link to comment Share on other sites More sharing options...
Dotaz
SpyLine 0
Zdravím,
dnes jsem si dělal do gamemodu lock system na principu, že když zmáčknete tlačítko, zamkne se auto.
Jenže se nic nestane, ani GmTxt se nenapíše..
Code zde:
Budu rád za každou pomoc.
Link to comment
Share on other sites
39 odpovědí na tuto otázku
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now