/hduty komanda(skin problem)

Započeo Ivo#2312, Maj 08, 2023, 18:20:49 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Problem(error/warning): Kad odem sa helper dužnosti neće da mi seta skin 24 nego seta neki sasvim drugi
Deo skripte:
[pawn]
YCMD:hduty(playerid, params[], help) {

    static string[128];
    if(!player_Helper[playerid]) return SendClientMessage(playerid, x_red, "ERROR: "c_white"Niste clan helper tima!");
    if(HelperDuty[playerid] == false) {
        SetPlayerSkin(playerid, 188);
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 100);
        SetPlayerColor(playerid, 0x009933AA);
        HelperDuty[playerid] = true;
        defer HelperDutyTimer(playerid);

        if(player_Helper[playerid] == 1) {
            format(string, sizeof(string), ""c_green"Helper "c_white"%s (Duty: "c_green"%d"c_white") je sada na duznosti", ReturnPlayerName(playerid), player_HelperDutyTime[playerid]);
            SendClientMessageToAll(-1, string);
        }
    }
    else if(HelperDuty[playerid] == true) {
        HelperDuty[playerid] = false;
        SetPlayerSkin(playerid, 24);
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 0);
        SetPlayerColor(playerid, 0xFFFFFFFF);
        if(player_Helper[playerid] == 1) {
            format(string, sizeof(string), ""c_green"Helper "c_white"%s (Duty: "c_green"%d"c_white") vise nije na duznosti", ReturnPlayerName(playerid), player_HelperDutyTime[playerid]);
            SendClientMessageToAll(-1, string);
        }
    }

    new INI:File = INI_Open(Account_Path(playerid));
    INI_SetTag(File, "data");
    INI_WriteInt(File, "Skin", player_Skin[playerid]);
    INI_WriteInt(File, "HelperDuty", player_HelperDutyTime[playerid]);
    INI_Close(File);
   
    return 1;

}
[/pawn]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): [pawn]/[/pawn]
Slika/video ingame problema(obavezno ako je ingame problem): /
Poslednja Izmena: Maj 08, 2023, 18:22:56 POSLE PODNE od Ivo Dev

Necu se previse pametan praviti jer nisam skripter samo sam primjetio ovo


SetPlayerSKIN je 188 kada Helper uzima duty
    static string[128];
    if(!player_Helper[playerid]) return SendClientMessage(playerid, x_red, "ERROR: "c_white"Niste clan helper tima!");
    if(HelperDuty[playerid] == false) {
        SetPlayerSkin(playerid, 188);
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 100);
        SetPlayerColor(playerid, 0x009933AA);
        HelperDuty[playerid] = true;
        defer HelperDutyTimer(playerid);

        if(player_Helper[playerid] == 1) {
            format(string, sizeof(string), ""c_green"Helper "c_white"%s (Duty: "c_green"%d"c_white") je sada na duznosti", ReturnPlayerName(playerid), player_HelperDutyTime[playerid]);
            SendClientMessageToAll(-1, string);
        }


A kada skida duty mu seta na skin ID 24


    else if(HelperDuty[playerid] == true) {
        HelperDuty[playerid] = false;
        SetPlayerSkin(playerid, 24);
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 0);
        SetPlayerColor(playerid, 0xFFFFFFFF);
        if(player_Helper[playerid] == 1) {
            format(string, sizeof(string), ""c_green"Helper "c_white"%s (Duty: "c_green"%d"c_white") vise nije na duznosti", ReturnPlayerName(playerid), player_HelperDutyTime[playerid]);
            SendClientMessageToAll(-1, string);
        }



Neka me neko ispravi ako grijesim i ja jos ucim :D
Poslednja Izmena: Maj 08, 2023, 19:14:58 POSLE PODNE od d3dic
Marketing Associate[/url]
Graphic Designer
UI/UX Designer
Instagram




[pawn]
YCMD:hduty(playerid, params[], help) {

    if(!player_Helper[playerid]) return SendClientMessage(playerid, x_red, "ERROR: "c_white"Niste clan helper tima!");
    if(HelperDuty[playerid] == false) {
        SetPlayerSkin(playerid, 188);
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 100);
        SetPlayerColor(playerid, 0x009933AA);
        HelperDuty[playerid] = true;
        defer HelperDutyTimer(playerid);

        if(player_Helper[playerid] == 1) {
            va_SendClientMessageToAll(-1, ""c_green"Helper "c_white"%s (Duty: "c_green"%d"c_white") je sada na duznosti", ReturnPlayerName(playerid), player_HelperDutyTime[playerid]);
        }
    }
    else if(HelperDuty[playerid] == true) {
        HelperDuty[playerid] = false;
        SetPlayerSkin(playerid, player_Skin[playerid]);
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 0);
        SetPlayerColor(playerid, 0xFFFFFFFF);
        if(player_Helper[playerid] == 1) {
            va_SendClientMessageToAll(-1, ""c_green"Helper "c_white"%s (Duty: "c_green"%d"c_white") vise nije na duznosti", ReturnPlayerName(playerid), player_HelperDutyTime[playerid]);
        }
        new INI:File = INI_Open(Account_Path(playerid));
        INI_SetTag(File, "data");
        INI_WriteInt(File, "Skin", player_Skin[playerid]);
        INI_WriteInt(File, "HelperDuty", player_HelperDutyTime[playerid]);
        INI_Close(File);
    }
   
    return 1;

}[/pawn]
Hoće mi netko pomoći oko ovoga sad mi seta cj skin kad sam malo prepravio ovo

Eto ti, takodje ne treba ti cuvanje skina svakako on svaki put kada ukuca /hduty njemu menja mislim da je to totalno nepotrebno.
[pawn]
CMD:hduty(playerid, params[])
{
    if(!player_Helper[playerid]) return SendClientMessage(playerid, x_red, "ERROR: "c_white"Niste clan helper tima!");
    defer HelperDutyTimer(playerid);
    HelperDuty[playerid] = HelperDuty[playerid] == 1 ? 0 : 1;
    va_SendClientMessageToAll(-1 , ""c_green"Helper "c_white"%s (Duty: "c_green"%d"c_white") %s", ReturnPlayerName(playerid), player_HelperDutyTime[playerid], HelperDuty[playerid] == 1 ? "je sada na duznosti." : "vise nije na duznosti.");
    SetPlayerArmour(playerid, 99.0); SetPlayerHealth(playerid, 99.0); SetPlayerColor(playerid, 0xFFFFFFFF); TogglePlayerControllable(playerid, true);
    if(HelperDuty[playerid] == 1) { SetPlayerSkin(playerid, 188); } else if (HelperDuty[playerid] == 0) { SetPlayerSkin(playerid, 24); }
    new INI:File = INI_Open(Account_Path(playerid));
    INI_SetTag(File, "data");
    INI_WriteInt(File, "HelperDuty", player_HelperDutyTime[playerid]);
    INI_Close(File);
    return 1;
}

[/pawn]
Poslednja Izmena: Maj 09, 2023, 00:53:56 PRE PODNE od Goku ^