Jump to content

(Intrebare) Hunter Job - OnPlayerShootObject


Recommended Posts

Pai, vreau sa fac SINGUR un job de tip 'Hunter' si vreau intr-un fel sa vanez 3-4 caprioare, asa,intrebare este, cum as putea pune comanda asta in script OnPlayerShootObject, adica, cum ar trebui sa o implementez. Daca stie cineva.

Link to post
Share on other sites

Cea mai importanta parte e sa creezi acele caprioare (obiecte), iar la OnPlayerShootObject verifici daca  un player trage in obiectul respectiv sa se intample minunea. Ii atribui un ID fiecarei caprioare:

new caprioara;

public OnGameModeInit() {
	caprioara = CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_OBJECT_SD, Float:drawdistance = STREAMER_OBJECT_DD, STREAMER_TAG_AREA areaid = STREAMER_TAG_AREA -1, priority = 0)
}

public OnPlayerShootDynamicObject(playerid, weaponid, objectid, Float:x, Float:y, Float:z) {
	if(caprioara == objectid) {
		SendClientMessage(playerid, -1, "Ai atins caprioara.");
	}
}

Ai nevoie de streamer, mai departe foloseste-ti imaginatia.

Edited by L0K3D.
  • Fok 1
Link to post
Share on other sites
8 hours ago, L0K3D. said:

Cea mai importanta parte e sa creezi acele caprioare (obiecte), iar la OnPlayerShootObject verifici daca  un player trage in obiectul respectiv sa se intample minunea. Ii atribui un ID fiecarei caprioare:

new caprioara;

public OnGameModeInit() {
	caprioara = CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_OBJECT_SD, Float:drawdistance = STREAMER_OBJECT_DD, STREAMER_TAG_AREA areaid = STREAMER_TAG_AREA -1, priority = 0)
}

public OnPlayerShootDynamicObject(playerid, weaponid, objectid, Float:x, Float:y, Float:z) {
	if(caprioara == objectid) {
		SendClientMessage(playerid, -1, "Ai atins caprioara.");
	}
}

Ai nevoie de streamer, mai departe foloseste-ti imaginatia.

Mersiiiii muuult, apreciez enorm ajutorul!!!

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. 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.