Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: Markoni990 poslato Februar 05, 2015, 13:10:16 POSLE PODNE

Naslov: [Pomoc]Oko udaranja admina
Poruka od: Markoni990 poslato Februar 05, 2015, 13:10:16 POSLE PODNE
Skripta koju koristim: GTA RP
Detaljan opis problema:Pa ocu kad je admin na duznosti i obican igrac udari admina da ga kiluje! E sad kod mene pod onplayertakedamage mi i tazer sistem.
Dio skripte: public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID)
    {
  if(IsACop(playerid))
{
        new Float:armour, Float:health; GetPlayerArmour(playerid, armour); GetPlayerHealth(playerid, health);
        if(weaponid == ORUZJE)
        {
        if (ProxDetectorS(10.0, issuerid, playerid))
{
            if(IsPlayerInAnyVehicle(playerid))
{
return 1;
}
if(PlayerInfo[playerid][pTazovan] == 1) return SCM(issuerid,COLOR_WHITE,"Taj igrac je vec tazovan");
if(PlayerInfo[playerid][pAdmin] >= 4) return SCM(issuerid,COLOR_WHITE,"Ne mozes tazovati OSC-a");
            if(KORISTI_SKIN != 0 && SKIN_ID == GetPlayerSkin(issuerid))
            {
            new string[66];
format(string, sizeof(string), "* Sokirani ste na %d sekundi.",SEKUNDE_TAZERA); SCM(playerid, BOJA_PORUKE, string);
PlayerInfo[playerid][pTazovan] = 1;
PlayAudioStreamForPlayer(playerid,"http://k005.kiwi6.com/hotlink/j8c371qqax/tazz.mp3",0,0,0,0,0);
format(string, sizeof(string), "* Pogodjeni igrac je sokiran na %d sekundi.",SEKUNDE_TAZERA); SCM(issuerid, BOJA_PORUKE, string);
format(string, sizeof(string), "~r~%s", GAMETEXT); GameTextForPlayer(playerid, string, 2500, 3); TogglePlayerControllable(playerid, 0);
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); SetTimerEx("TazovanTajmer",SEKUNDE_TAZERA*1000, false, "i", playerid);
return 1;
}
else
{
new string[66];
format(string, sizeof(string), "* Sokirani ste na %d sekundi.",SEKUNDE_TAZERA); SCM(playerid, BOJA_PORUKE, string);
PlayerInfo[playerid][pTazovan] = 1;
PlayAudioStreamForPlayer(playerid,"http://k005.kiwi6.com/hotlink/j8c371qqax/tazz.mp3",0,0,0,0,0);
format(string, sizeof(string), "* Sokirali ste pogodjenog igraca na %d sekundi.",SEKUNDE_TAZERA); SCM(issuerid, BOJA_PORUKE, string);
    format(string, sizeof(string), "~r~%s", GAMETEXT); GameTextForPlayer(playerid, string, 2500, 3); TogglePlayerControllable(playerid, 0);
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); SetTimerEx("TazovanTajmer",SEKUNDE_TAZERA*1000, false, "i", playerid);
            return 1;
}
        }
        }
    }
}
    return 1;
}
Naslov: Odg: [Pomoc]Oko udaranja admina
Poruka od: Denis_Lapi poslato Februar 05, 2015, 13:43:49 POSLE PODNE
Je l ti ne znas to da uradis, ili ti pravi problem sto ne znas gde da u okviru tog publica ubacis sa ovo sto hoces da napravis?
Naslov: Odg: [Pomoc]Oko udaranja admina
Poruka od: Markoni990 poslato Februar 05, 2015, 16:07:02 POSLE PODNE
Ma pravio sam ja ali neznam dal sam dobro uradio
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID)
    {
    if(PlayerInfo[issuerid][pAdmin] >= 1)
    {
        SetPlayerHealth(playerid,0);
    }
  if(IsACop(playerid))
{
        new Float:armour, Float:health; GetPlayerArmour(playerid, armour); GetPlayerHealth(playerid, health);
        if(weaponid == ORUZJE)
        {
        if (ProxDetectorS(10.0, issuerid, playerid))
{
            if(IsPlayerInAnyVehicle(playerid))
{
return 1;
}
if(PlayerInfo[playerid][pTazovan] == 1) return SCM(issuerid,COLOR_WHITE,"Taj igrac je vec tazovan");
if(PlayerInfo[playerid][pAdmin] >= 4) return SCM(issuerid,COLOR_WHITE,"Ne mozes tazovati OSC-a");
            if(KORISTI_SKIN != 0 && SKIN_ID == GetPlayerSkin(issuerid))
            {
            new string[66];
format(string, sizeof(string), "* Sokirani ste na %d sekundi.",SEKUNDE_TAZERA); SCM(playerid, BOJA_PORUKE, string);
PlayerInfo[playerid][pTazovan] = 1;
PlayAudioStreamForPlayer(playerid,"http://k005.kiwi6.com/hotlink/j8c371qqax/tazz.mp3",0,0,0,0,0);
format(string, sizeof(string), "* Pogodjeni igrac je sokiran na %d sekundi.",SEKUNDE_TAZERA); SCM(issuerid, BOJA_PORUKE, string);
format(string, sizeof(string), "~r~%s", GAMETEXT); GameTextForPlayer(playerid, string, 2500, 3); TogglePlayerControllable(playerid, 0);
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); SetTimerEx("TazovanTajmer",SEKUNDE_TAZERA*1000, false, "i", playerid);
return 1;
}
else
{
new string[66];
format(string, sizeof(string), "* Sokirani ste na %d sekundi.",SEKUNDE_TAZERA); SCM(playerid, BOJA_PORUKE, string);
PlayerInfo[playerid][pTazovan] = 1;
PlayAudioStreamForPlayer(playerid,"http://k005.kiwi6.com/hotlink/j8c371qqax/tazz.mp3",0,0,0,0,0);
format(string, sizeof(string), "* Sokirali ste pogodjenog igraca na %d sekundi.",SEKUNDE_TAZERA); SCM(issuerid, BOJA_PORUKE, string);
    format(string, sizeof(string), "~r~%s", GAMETEXT); GameTextForPlayer(playerid, string, 2500, 3); TogglePlayerControllable(playerid, 0);
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); SetTimerEx("TazovanTajmer",SEKUNDE_TAZERA*1000, false, "i", playerid);
            return 1;
}
        }
        }
    }
}
    return 1;
}

Naslov: Odg: [Pomoc]Oko udaranja admina
Poruka od: ▂ ▃ ▅ Rudimental ▅ ▃ ▂ poslato Februar 05, 2015, 16:55:55 POSLE PODNE
Prouci malo parametre za taj callback preko samp wikia jer ovo sto si ti uradio ispadne ako admin uradi nekog da taj neko umre


if(PlayerInfo[issuerid][pAdmin] >= 1)
{
    SetPlayerHealth(playerid, 0);
}


A to sto ti hoces bi islo ovako

if(PlayerInfo[playerid][pAdmin] > 0)
{
    SetPlayerHealth(issuerid, 0);
}
Naslov: Odg: [Pomoc]Oko udaranja admina
Poruka od: Markoni990 poslato Februar 05, 2015, 16:58:51 POSLE PODNE
Hvala brt :D