LOGO
Username Icons
100$
Username Effects
150$
Username Change
300$
Profile Cover
250$
Userbar Hue
100$
Change Username Color
1000$
Spotify listening status
150$
Arcade access
400$
Reputation power
500$
Warn Remover ( -1 )
5000$
Customize your MyBB profile with our shop’s options! Choose from username changes, colors, and profile covers and more others to enhance your forum identity.
Go to shop
CSGO.WTFCS.COM
Connect
CS.WTFCS.COM
Connect
XMAS.WTFCS.COM
Connect
PB.WTFCS.COM
Connect
DR.WTFCS.COM
Connect
WAR.WTFCS.COM
Connect
WAR1.WTFCS.COM
Connect
www.Game-State.com
SAMP
Connect
www.Game-State.com
MINECRAFT
Connect
Hello There, Guest!
If you encounter issues with quick login, use the link below for direct access.
Open Log In ( Directly page )
×
Register
Show Serverlist
ChatBox
345
TUTORIAL Taser System
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
#1
Autor: khain

Comanda /taser pentru politisti, fbi etc.

Code:
/* variabila */
new
  taser[MAX_PLAYERS] /* avem nevoie de aceasta variabila pentru activare si dezactivare a tase-rului */
;

/* mergem in OnPlayerConnect */

public OnPlayerConnect(playerid) {
 
  /* atribuim player-ului la conectarea pe server taser dezactivat */
  taser[playerid] = 0; /* taser - variabila atrbuita la inceput | playerid - id jucator | 0 - raspunde ca functie neactiva */

  return 1;
}

/* Mergem in OnPlayerKeyStateChange */
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_YES) { /* activarea/dezactivarea are loc prin butonul Y | KEY_YES - Y */   
      new
        weap, /* inregistram prin weap arma noastra ca taser */
        ammo; /* id arma */
     
      /* functia ce verifica daca are jucatorul arma necesara */
      GetPlayerWeaponData(playerid,2,weap,ammo); /* playerid - id jucator | 2 - slot | weap - arma inregistrata ca taser | ammo - id arma */

      /* verificam daca player-ul are arma necesara, in cazul meu Deagle. */
      if(weap != 24)
          return
              SendClientMessage(playerid, -1, "Nu ai arma necesara pentru Taser.");

      /* verificam daca taser-ul este activat */
      if(taser[playerid]) {
        taser[playerid] = 0;
        return
          SendClientMessage(playerid, -1, "Tase-rul nu este activat.");
      }
      else {  /* activam taser-ul */
          taser[playerid] = 1;
          return
              SendClientMessage(playerid,-1,"Taser-ul a fost activat.");
      }
    }
    return 1;
}

/* mergem in OnPlayerWeaponShot */
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{

  if(hittype == 1 && weaponid == 24 && taser[playerid] == 1) return staser(playerid,hitid);
  //hittype - tipul de foc, in cazul nostru se atribuie la playerl [ 1 - player ]
  //weaponid - id arma
  //taser[playerid] - deja stiti ( atribuire 1 - stock-ul pe care il avem, i se atribuie armei introduse de noi la variabila care inregistreaza statusul   taserului
  return 1;
}

/* megem in orice loc al GM-ului */
stock staser(playerid, suspectid) {
 
  SetPlayerSpecialAction(suspectid,SPECIAL_ACTION_HANDSUP); // atribuim animatia care dupa idee il electrocuteaza
  ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "{9ACD32}Taser", "\n\nAi fost electrocutat cu o arma speciala Taser ( Deagle )\n\n", "x", ""); // informam player-ul ca a fost electrocutat.
  return 0;
}
*voi puteti adauga verificarile necesare
Mihai nu face flotari, el le cumpara gata facute!
Mihai s-a nascut intr-o cabana construita de el.
Mihai a omorat 50 de teroristi din 2 gloante.Primul a fost de avertizare.
Mihai poate sa isi faca poze cu telefonul fix.
Mihai a raspuns la un apel pierdut.
Singura femeie care si-a permis sa faca glume despre Mihai a fost Elodia, de aia nu mai este.
Cand Mihai iti arata degetul nu o face ca sa te injure... doar iti arata cate secunde mai ai de trait!
You are not allowed to view links. Register or Login to view.
You are not allowed to view links. Register or Login to view. You are not allowed to view links. Register or Login to view. 


Forum Jump:


Users browsing this thread: 1 Guest(s)