Jump to content

Fake Bullets - Tutorial


Recommended Posts

V-ati intrebat cum e sa sperii pe cineva cand tragi in el si sa nu-i scoata HP? Asta poate fi si un fel de /god.

Bun, prima data avem nevoie doar de 1 includer.

scrieti asta la locul includerului.

#include <zcmd>

Ne vom folosi de el sa facem comenzi.

Acum cream variabila.

new fakeBullets[MAX_PLAYERS];

De aceasta variabile ne vom folosi ca sa definim cand playerul are gloantele false.

Acum cream comanda.

CMD:fakebullets(playerid, params[]) { //Cream comanda
	if(isnull(params)) return SendClientMessage(playerid, -1, "/FakeBullets [ON/OFF]");
	if(strcmp(params, "on", true) == 0) return fakeBullets[playerid] = 1, SendClientMessage(playerid, -1, "/FakeBullets [ON]"), PlayerPlaySound(i,1057,0.0,0.0,0.0);
	if(strcmp(params, "off", true) == 0) return fakeBullets[playerid] = 0, SendClientMessage(playerid, -1, "/FakeBullets [OFF]"), PlayerPlaySound(i,1057,0.0,0.0,0.0);
	return 1; }


if(isnull(params)) return etc. Daca nu scrie nimic ii va da mesaj sa scrie on sau off.

if(strcmp..etc) adica playerul trebuie sa scrie /fakebullets on ca sa porneasca fake bullets si /fakebullets off ca se le opreasca.


public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)


if(fakeBullets[playerid] == 1) return SetPlayerHealth(damagedid, 100);

Explicatie: Cand jucatorul primeste damage iar playerul ce a tras avea fakebullets on, i se va seta viata 100 de fiecare data cand este lovit de gloante.

Atentie, OnPlayerGiveDamage este inacurat cateodata si acel player poate muri.

Cam asta a fost.


Multumesc lui Giskard pentru aceasta idee, aceste fake bullets sunt un fel de gloante oarbe.

Edited by cristyifrim31O
Link to comment
Share on other sites

  • 2 months later...

Am o singura intrebare. Daca setezi SetPlayerHealth 100 si jucatorul are 30 viata s'ar crea un bug?

in care nimeni nu ar mai merge sa manance sau sa cheme ambulanta (rpg). 

if(fakeBullets[playerid] == 1) return SetPlayerHealth(damagedid, 100);

AM dreptate ?


Link to comment
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.

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

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.