Jump to content

Recommended Posts

Posted (edited)

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; }

Explicatie.

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.

La 

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

adaugam:

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
  • 2 months later...
Posted

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 ?

 

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.