Jump to content
  • 1

Cerere ID obiect


Shad0wdpbgd

Question

Salut, am o problema cu un obiect (camera) care nu il gasesc, absolut niciunde. (nici pe site uri specializate pt asa cv)

Am incercat sa fac un sistem de rob, merge totu, dar trebuie sa pun o camera. doar ca atunci cand trag prin ea nu se intampla nimic, trece prin ea( alta camera nu asta )

Si a da, cu alte obiecte merge (de ex daca pun un cos de gunoi merge sa trag in el si sa dispara si sa pot sa iau banii din seif.

Stie cineva  ID-ul de la camera asta ? (are collision)

https://imgur.com/a/tAEpx6S

Pls

Link to comment
Share on other sites

20 answers to this question

Recommended Posts

  • 0

Acela este obiectul, pozele sunt la fel.

Cat despre problema coliziunii, nu prea ai ce sa faci, dar poti adauga un al doilea obiect cum ar fi id 19900 de aproximativ aceleasi dimensiuni in acelasi loc, aplici textura de geam sau una complet transparenta sa il faci invizibiil si te folosesti de acesta, cand se trage in el obiectul Camera[1] sa fie distrus.

  • Upvote 1

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0

S-ar putea ca obiectul din poză să fie unul custom, făcut pentru server-ul respectiv (unde ai găsit imaginea). Singurul obiect pe care l-am găsit este ăsta.

 

// edit: am mai găsit un obiect aproape asemănător cu ceea ce dorești tu: link.

Edited by matei_
Link to comment
Share on other sites

  • 0
  • 0
4 minutes ago, Raduq said:

am vazut pe b hood camera aia care are coliziune dar nush ce id are (chiar daca joc pe bugged)

aparent nu exista niciun CCTV cu coliziune.

ceea ce vrei tu mai exact e destroy on hit.

Link to comment
Share on other sites

  • 0
1 minute ago, Raduq said:

ok, o sa vad ce o sa fac

incearca sa creezi un obiect custom si sa-i faci tu coliziunea si restul detaliilor care te intereseaza daca tii neaparat sa folosesti ideea respectiva pt rob.
gasesti pe internet idei despre ce si cum.
 

Link to comment
Share on other sites

  • 0

Salutare, 

foloseste functia OnPlayerShootDynamicObject

obiectul respectiv creazal de tip dynamic, Camera[1] = CreateDynamicObject

iar in functie folosesti if objectid == Camera[1]  DestroyDynamicObject Camera[1]

apoi iti restrictionezi totul in functie de sistemul tau de rob, adaugi ce e de adaugat

EDIT: ID ul obiectul s a aflat.

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0
12 minutes ago, Mister said:

Salutare, 

foloseste functia OnPlayerShootDynamicObject

obiectul respectiv creazal de tip dynamic, Camera[1] = CreateDynamicObject

iar in functie folosesti if objectid == Camera[1]  DestroyDynamicObject Camera[1]

apoi iti restrictionezi totul in functie de sistemul tau de rob, adaugi ce e de adaugat

EDIT: ID ul obiectul s a aflat, topic closed.

exact asa am facut, dar trece prin si nu merge, de ex daca pun un stalp acolo, merge perfect

Link to comment
Share on other sites

  • 0

OnPlayerWeaponShot 

folosesti parametrii

playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
 #define BULLET_HIT_TYPE_NONE                0
 #define BULLET_HIT_TYPE_PLAYER              1
 #define BULLET_HIT_TYPE_VEHICLE             2
 #define BULLET_HIT_TYPE_OBJECT              3
 #define BULLET_HIT_TYPE_PLAYER_OBJECT       4

hitid
hitid is the ID in relating to the hittype. In case if hittype goes TYPE_PLAYER, it returns the player ID as hitid. Or if it's a vehicle, it returns the vehicle's ID as hitid. Same facts on object and player-objects; it will return the object ID or player object ID in case if the hittype is either TYPE_OBJECT or TYPE_PLAYER_OBJECT.

fX, fY, fZ
These are the offsets within the object ID, vehicle ID or the player's skin. Which means the position where the bullet gets hit. Not actually the POS, but the offset position of an object, player-object, vehicle or a player's skin.

reduci HP-ul obiectului si-l distrugi

 

public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{

if(hittype == BULLET_HIT_TYPE_OBJECT) { // pentru obiect

if(IsValidObject(hitid)) {
ObjectHP[hitid] -= random(10) + 1; // damage-ul
if(ObjectHP[hitid] <= 0) { // verificarea pt distrugere, hp -/= 0
DestroyObject(hitid);

creeaza si variabila care-i permite obiectului sa ia damage

new ObjectHP[MAX_OBJECTS];
    bool:ObiectDamage[MAX_OBJECTS];

si mai departe.

Edited by RXS
Link to comment
Share on other sites

  • 0
16 minutes ago, Mister said:

Acela este obiectul, pozele sunt la fel.

Cat despre problema coliziunii, nu prea ai ce sa faci, dar poti adauga un al doilea obiect cum ar fi id 19900 de aproximativ aceleasi dimensiuni in acelasi loc, aplici textura de geam sau una complet transparenta sa il faci invizibiil si te folosesti de acesta, cand se trage in el obiectul Camera[1] sa fie distrus.

am facut cum ai spus, sper sa mearga

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.