Ne tazuje igraca


Započeo #Kiki, Februar 21, 2020, 00:27:18 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim : Unicate Gaming edit
Problem : imam problem , znaci kad PD uzme vadi tazer i puca u igraca uopste se nista ne desava nit freeza nit ga obori .. Ne znam u cemu je problem help sto pre ako moze
   
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
	if(IgracPolicajac(issuerid))
	{
		if(GetPlayerWeapon(issuerid) == 23)
		{
			new string[512];
			if(PlayerInfo[playerid][pTrazeniLevel] == 0) return SCM(issuerid,-1,""PLAVA"[GRESKA] "SIVA"Igrac nema Wanted Level!");
			if(IgracPolicajac(playerid)) return SCM(issuerid,-1,""PLAVA"INFO | "SIVA"Ne mozes tazovati PD!");
			if(PlayerInfo[issuerid][pRank] == 0) return SCM(issuerid,-1,""PLAVA"INFO | "SIVA"Suspendovan si!");
			if(AdminDuty[playerid] == 1) return SCM(issuerid,-1,""PLAVA"INFO | "SIVA"Taj igrac je Admin na duznosti!");
			format(string, sizeof(string), "%s puca tazerom na %s-a i pogadja ga.", GetName(issuerid) ,GetName(playerid));
			ProxDetector(20.0, issuerid, string, PROX,PROX,PROX,PROX,PROX);
			TogglePlayerControllable(playerid, 0); IgracTazovan[playerid] = 1;
			TazerTimer[playerid] = SetTimerEx("TazovanTajmer", 15000, false, "i", playerid);
			OnePlayAnim(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
		}
	}
	return 1;
}
Lewinston Gaming | Owner & Developer |
  ----- @sargic_ -------


Imam includovan Weapon-config
Lewinston Gaming | Owner & Developer |
  ----- @sargic_ -------

# How to use

1. `#include <weapon-config>` before any other script
2. Replace `OnPlayerGiveDamage` and `OnPlayerTakeDamage` with just one callback:
    
    ```pawn
    public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart)
    ```
3. Add config functions in `OnGameModeInit` (or any other places, they can be called at any time).
    **Recommended**:
    
    ```pawn
    public OnGameModeInit() {
        SetVehiclePassengerDamage(true);
        SetDisableSyncBugs(true);
    }
    ```


Tu ti lepo pise sta treba da uradis.

- Ukratko pre svakog includea posle a_samp includeaj weapon config i takodje SKY jer ti je potreban uz weapon config
- Zameni callback OnPlayerGiveDamage i OnPlayerTakeDamage sa
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart)

- U trecem koraku samo ubaci tu funkciju kod OnGameModeInit ili bilo gde gde ta funkcija moze biti pozvana (moze a i ne mora ali se preporucuje).