Problem(error/warning): Nisu bile animacije na server samim tim nije radio tazer, ako moze neko da podesi, ubacio sam animacije opet ne radi tazer
Dio skripte: [pawn]public OnPlayerTakeDamage( playerid, issuerid, Float:amount, weaponid, bodypart ) {
if( issuerid != INVALID_PLAYER_ID && issuerid != INVALID_PLAYER_ID && amount == 0 && weaponid == 0 && bodypart == 3 ) {
format( globalstring, sizeof( globalstring ), "| BK:AC | %s je kickovan sa servera. Razlog: "col_white"Command kill", ImeIgraca( issuerid ) );
AdminPoruka( SVETLOCRVENA, globalstring );
Kickovanje( issuerid, ""col_white"Ti si kickovan sa servera. Razlog: "SRWBOJA"Command kill");
return 0;
}
if( issuerid != INVALID_PLAYER_ID ) {
if( OI[ PlayerInfo[ issuerid ][ xClan ] ][ oTip ] == ORG_TIP_PD && !IsPlayerInAnyVehicle( issuerid ) && !IsPlayerInAnyVehicle( playerid ) && GetWeapon( issuerid ) == 23 && ImaTazer[ issuerid ] == true && !AdminDuty[ playerid ] ) {
if( GetFactionType( playerid ) == ORG_TIP_PD ) return SCM( issuerid, CRVENA, "Ne mozes tazovati PD!" );
new Float:Pos[ 3 ];
GetPlayerPos( playerid, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ] );
if( IsPlayerInRangeOfPoint( issuerid, 10.0, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ] ) ) {
format( globalstring, sizeof( globalstring ), "%s puca tazerom na %s-a i pogadja ga.", ImeIgraca( issuerid ), ImeIgraca( playerid ) );
PorukaRadius( 20.0, issuerid, globalstring, LJUBICASTA );
TogglePlayerControllable( playerid, false );
if( Maskuse[ playerid ] == true ) {
SetPlayerName( playerid, RealName[ playerid ] );
Maskuse[ playerid ] = false;
}
PlayerCuffed[ playerid ] = 1;
Marley_SetPlayerHealth( playerid, 50 );
SetPVarInt( playerid, "CuffTimerCalled", 1 );
TazerTimer[ playerid ] = SetTimerEx("TazovanTajmer", 15000, false, "i", playerid );
OnePlayAnim( playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0 );
return 0;
}
}
/*if( NaDmEventu[ playerid ] == false && WARPInfo[ playerid ][ WARIgrac ] == -1 && !AdminDuty[ playerid ] && PlayerCuffed[ playerid ] == 0 ) {
if( weaponid <= 42 ) {
new Float:takeHealth = antiCheatCS[ playerid ][ TrueHealth ] - WeaponDamage[ weaponid ][ bodypart - 3 ];
Marley_SetPlayerHealth( playerid, takeHealth );
}
}*/
//printf( "%s je naneo %.0f demidza %s-u, oruzje: %d, deo tela: %d", ImeIgraca( issuerid ), amount, ImeIgraca( playerid ), weaponid, bodypart );
}
return 1;
}
public TazovanTajmer( playerid ) {
if( PlayerCuffed[ playerid ] == 1 ) {
PlayerCuffed[ playerid ] = 0;
SetPVarInt( playerid, "CuffTimerCalled", 0 );
TogglePlayerControllable( playerid, true );
GameTextForPlayer( playerid, "~y~Tazer zavrsen", 5000, 3 );
ClearAnimations( playerid );
Marley_KillTimer( TazerTimer[ playerid ] );
}
return 1;
}[/pawn]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): [ code ]vaš odgovor[ /code ]
Slika/video ingame problema(obavezno ako je ingame problem): link slike
[pawn]//RP TAZER SYSTEM BY Mitsuki
// "Tazer" proverava da li je tazer ukljucen 1 za da 0 za ne.
// KOMANDE TAZER SYSTEMA su /tazeron i /tazeroff , mozes ih promeniti ako zelis //
//===========================[Includes]=========================================
#include <a_samp>
//===========================[Defines]==========================================
#define FILTERSCRIPT
#if defined FILTERSCRIPT
//===========================[New]==============================================
new Tazer[MAX_PLAYERS];
public OnFilterScriptInit()
{
print("\n-----------------------------------------");
print(" Tazer system by Mitsuki ( LOADED ) ");
print("-------------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
print("\n--------------------------------------------");
print(" Tazer system by Mitsuki ( UNLOADED ) ");
print("---------------------------------------------\n");
return 1;
}
#endif
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
Tazer[playerid] = 0;
return 1;
}
public OnPlayerUpdate(playerid)
{
if(Tazer[playerid] == 1)
{
if(GetPlayerWeapon(playerid) == 0)
{
SetPlayerAttachedObject(playerid, 7, 18642, 6, 0.06, 0.01, 0.08, 180.0, 0.0, 0.0); //Tazer
return 1;
}
if(GetPlayerWeapon(playerid) != 0)
{
RemovePlayerAttachedObject(playerid, 7); //Ovo brise tazer
return 1;
}
}
return 1;
}
forward Float:GetDistanceBetweenPlayers(p1,p2);
public Float:GetDistanceBetweenPlayers(p1,p2)
{
new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
if(!IsPlayerConnected(p1) || !IsPlayerConnected(p2))
{
return -1.00;
}
GetPlayerPos(p1,x1,y1,z1);
GetPlayerPos(p2,x2,y2,z2);
return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
}
forward GetClosestPlayer(p1);
public GetClosestPlayer(p1)
{
new x,Float:dis,Float:dis2,player;
player = -1;
dis = 99999.99;
for (x=0;x<MAX_PLAYERS;x++)
{
if(IsPlayerConnected(x))
{
if(x != p1)
{
dis2 = GetDistanceBetweenPlayers(x,p1);
if(dis2 < dis && dis2 != -1.00)
{
dis = dis2;
player = x;
}
}
}
}
return player;
}
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
if(Tazer[playerid] == 1)
{
if(GetPlayerWeapon(playerid) == 0)
{
ApplyAnimation(playerid,"KNIFE", "knife_3", 4.0, 0, 1, 1, 1, 1000);
SetTimerEx("TimerClear",2000,false,"d",playerid);
new victimid = GetClosestPlayer(playerid);
if(IsPlayerConnected(victimid))
{
if(GetDistanceBetweenPlayers(playerid,victimid) < 2)
{
new Float:health;
GetPlayerHealth(victimid, health);
SetPlayerHealth(victimid, health - 5.0);
SetTimerEx("TimerFall",300,false,"d",victimid);
TogglePlayerControllable(victimid, 0);
SetTimerEx("Untaze", 20000, false, "i", victimid);
}
}
}
}
return 1;
}
forward Untaze(playerid);
public Untaze(playerid)
{
SendClientMessage(playerid, -1, "[Info] Vise niste tazovani!");
TogglePlayerControllable(playerid, 1);
return 1;
}
forward TimeClear(playerid);
public TimeClear(playerid)
{
ClearAnimations(playerid);
}
forward TimerFall(playerid);
public TimerFall(playerid)
{
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
SetTimerEx("TimerClear",19700,false,"d",playerid);
}
forward TimerCrack(playerid);
public TimerCrack(playerid)
{
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
SetTimerEx("TimeClear",19700,false,"d",playerid);
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/tazeron", cmdtext, true, 8) == 0)
{
if(Tazer[playerid] == 1)
{
SendClientMessage(playerid,-1,"[Info] Tvoj tazer je vec ukljucen!");
return 1;
}
Tazer[playerid] = 1;
SetPlayerAttachedObject(playerid, 7, 18642, 6, 0.06, 0.01, 0.08, 180.0, 0.0, 0.0);
SendClientMessage(playerid,-1,"[Info] Kucaj /tazeroff da iskljucis tazer!");
SendClientMessage(playerid,-1,"[Info] Tazer ce biti automatski tu kada prebacite na pesnicu.");
SendClientMessage(playerid,-1,"[Info] Da koristis tazer samo udari lika sa wantedom.");
return 1;
}
if (strcmp("/tazeroff", cmdtext, true, 9) == 0)
{
if(Tazer[playerid] == 0)
{
SendClientMessage(playerid,-1,"[Info] Tvoj tazer je vec iskljucen");
return 1;
}
Tazer[playerid] = 1;
RemovePlayerAttachedObject(playerid, 7);
SendClientMessage(playerid,-1,"[Info] Iskljucio si tazer , da ga ponovo ukljucis kucaj /tazeron");
return 1;
}
return 0;
}
/*================================================================================================================================
Gotovo !
================================================================================================================================*/[/pawn]
Pogledaj ovo , mozda ti pomogne , uzivaj :D
oj jbt prekomplikovano za moj mali mozak
Citat: Sinner.man poslato April 03, 2020, 13:37:27 POSLE PODNE
oj jbt prekomplikovano za moj mali mozak
Samo izvuci kod sistema ovo na pocetku ti ne treba