Jump to content
  • 0

Problema /sspecoff


TheGodfather

Question

Salut, cand dau /sspecoff la inhouse in loc sa imi puna valoarea 107 imi pune valoarea -1 chiar daca la ultimul mesaj de la /sspecoff la in house imi spune 107. Aveti idee de ce?

YCMD:sspec(playerid, params[], help) {
    if(aspam[playerid] > 0) return SCMf(playerid, COLOR_LIGHTRED, "[Command Anti-Spam] {FFFFFF}Wait %d %s.", aspam[playerid], aspam[playerid] > 1 ? "seconds" : "second");
    if(PlayerInfo[playerid][pAdmin] < 😎 return SCM(playerid, COLOR_WHITE, AdminOnly);
    virtualw = GetPlayerVirtualWorld(playerid);
    new id,string[180];
    if(sscanf(params, "u", id)) return SCM(playerid,COLOR_GREY, "Syntax: {FFFFFF}/spec <playerid/name>");
    if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SCM(playerid, COLOR_GREY, "That player is not connected.");
    if(id == playerid) return SCM(playerid, COLOR_GREY, "You can not use this command on you!");
    if(PlayerInfo[id][pAdmin] > PlayerInfo[playerid][pAdmin]) return SCM(playerid, COLOR_GREY, "You can not use this command on that player.");
    if(IsPlayerLogged[id] == 0) return SCM(playerid, COLOR_LGREEN, "Error: That player is logging!");
    Spectate[playerid] = id;
    SpecPlayers[playerid] ++;                    
    if(SpecPlayers[playerid] == 1) {
        GetPlayerPos(playerid, SpecPos[playerid][0], SpecPos[playerid][1], SpecPos[playerid][2]);
        IsPlayerSpec[playerid] = 1;
        pInteriorID[playerid] = GetPlayerInterior(playerid);
        pVirtual[playerid] = GetPlayerVirtualWorld(playerid);
        //inaintespec
        GetPlayerPos(playerid, InainteDeSpec[playerid][0], InainteDeSpec[playerid][1], InainteDeSpec[playerid][2]);
        inaintehouse[playerid] = InHouse[playerid];
        inaintehq[playerid] = InHQ[playerid];
        inaintebusiness[playerid] = InBussines[playerid];
        //inaintespec
    }
    new Float:health;
    GetPlayerHealthEx(Spectate[playerid], health);
    new rank[50];
    if(PlayerInfo[playerid][pAdmin] != 0) rank = "Admin";
    else rank = "Helper";
    
    
    if(GetPVarInt(id, "Reported") == 1 && GetPVarInt(id, "ReportType") != 4 && PlayerInfo[playerid][pAdmin] >= 1) {
        SetPVarInt(id, "Reported", 0);
        SetPVarInt(id, "ReportType", 0);
        SetPVarString(id, "ReportedBy", "");
        SetPVarInt(id, "ReportScore", 0);
        SetPVarString(id, "ReportText", "");        
    }
    if(PlayerInfo[playerid][pAdmin] >= 1 && GetPVarInt(id, "ReportType") != 4) {
        PlayerInfo[playerid][pHelpedPlayers] += GetPVarInt(id, "ReportScore");
        PlayerInfo[playerid][pHelpedPlayersToday] += GetPVarInt(id, "ReportScore");
    }    
    new szQuery[256];
    mysql_format(SQL, szQuery, sizeof(szQuery), "UPDATE users SET `HelpedPlayers` = '%d', `HelpedPlayersToday`='%d' WHERE `ID` = '%d'", PlayerInfo[playerid][pHelpedPlayers], PlayerInfo[playerid][pHelpedPlayersToday], PlayerInfo[playerid][pSQLID]);
    mysql_tquery(SQL, szQuery, "", "");
    
    format(string, sizeof(string), "[SPEC] (%d) %s | Level: %d | Health: %.2f | AFK Time: %d | Seconds: %.0f | Duty: %d | Ping: %d",id,GetName(id),PlayerInfo[id][pLevel], health, AFKSeconds[id], PlayerInfo[id][pSeconds], OnDuty[id], GetPlayerPing(id));
    SCM(playerid, 0xFFADADFF, string);
    
    new Player_Weapons[13], Player_Ammos[13], i, guns;
    string = "Weapons:";    
    for(i = 1;i <= 12;i++) {
        GetPlayerWeaponData(id,i,Player_Weapons[i],Player_Ammos[i]);
        if(Player_Weapons[i] != 0) {
            new weaponName[180];
            GetWeaponName(Player_Weapons[i],weaponName,255);
            format(string,255, "%s %s (%d)", string, weaponName,Player_Ammos[i]);
            guns ++;
        }
    }
    if(guns > 0) SCM(playerid, -1, string);
    Iter_Add(MySpec[id], playerid);

    TogglePlayerSpectating(playerid, 1);
    SetPlayerInterior(playerid, GetPlayerInterior(id));
    SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
    
    if(IsPlayerInAnyVehicle(Spectate[playerid])) PlayerSpectateVehicle(playerid, GetPlayerVehicleID(Spectate[playerid]));
    else PlayerSpectatePlayer(playerid, Spectate[playerid]);
    
    PlayerTextDrawSetString(playerid, SpectatorTD, "Loading...");
    PlayerTextDrawShow(playerid, SpectatorTD);                        
    return true;
}

YCMD:sspecoff(playerid, params[], help) {
    if(aspam[playerid] > 0) return SCMf(playerid, COLOR_LIGHTRED, "[Command Anti-Spam] {FFFFFF}Wait %d %s.", aspam[playerid], aspam[playerid] > 1 ? "seconds" : "second");
    if(PlayerInfo[playerid][pAdmin] < 😎 return SCM(playerid, COLOR_WHITE, AdminOnly);
    if(Spectate[playerid] == 255) return SCM(playerid, COLOR_GREY, "You are not spectating a player.");
    TogglePlayerControllable(playerid, 1);
    TogglePlayerSpectating(playerid, 0);
    PlayerInfo[playerid][pInt] = pInteriorID[playerid];
    PlayerInfo[playerid][pLocal] = pVirtual[playerid];
    SetPlayerInterior(playerid, pInteriorID[playerid]);
    Unspec[playerid][sLocal] = 255;
    gTeam[playerid] = PlayerInfo[playerid][pTeam];
    SetPlayerToTeamColor(playerid);
    SCM(playerid, -1, "You are no longer spectating!");
    Iter_Remove(MySpec[Spectate[playerid]], playerid);
    Spectate[playerid] = 255;
    SpecPlayers[playerid] = 0;
    LastRecon[playerid] = 1;
    PlayerTextDrawHide(playerid, SpectatorTD);
    Iter_Clear(MySpec[playerid]);
    //inaintespec
    SetPlayerPos(playerid, InainteDeSpec[playerid][0], InainteDeSpec[playerid][1], InainteDeSpec[playerid][2]);
    InHouse[playerid] = inaintehouse[playerid];
    InHQ[playerid] = inaintehq[playerid];
    InBussines[playerid] = inaintebusiness[playerid];
    SCMf(playerid, -1, "house: %d l hq: %d l Biz: %d", InHouse[playerid], InHQ[playerid], InBussines[playerid]);
    //inaintespec
    return true;
}

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0
2 minutes ago, iSorin[] said:

de unde stii tu ca valorea este -1? ai ceva comanda prin care iti arata? daca da arato

YCMD:test(playerid, params[], help) {
    SCMf(playerid, -1, "pInt: %d l pLocal: %d l InHouse: %d l InHQ: %d l InBussines: %d", PlayerInfo[playerid][pInt], PlayerInfo[playerid][pLocal], InHouse[playerid], InHQ[playerid], InBussines[playerid]);
    return 1;
}

Link to comment
Share on other sites

  • 0

Am incercat si asa iar cand dau /test imi spune ca la InHouse e -1...

SetPlayerPos(playerid, InainteDeSpec[playerid][0], InainteDeSpec[playerid][1], InainteDeSpec[playerid][2]);
    InHouse[playerid] = 107;//inaintehouse[playerid];
    InHQ[playerid] = inaintehq[playerid];
    InBussines[playerid] = inaintebusiness[playerid];
    SCMf(playerid, -1, "house: %d l hq: %d l Biz: %d", InHouse[playerid], InHQ[playerid], InBussines[playerid]);

return true;

Link to comment
Share on other sites

  • 0
1 minute ago, iSorin[] said:

de ce InHouse[playerid] trebuie sa fie neaprat 107?

Nu e neaparat sa fie 107, asta e valoarea pe care trebuie sa o puna pentru casa in care testez. De asta am pus 107 dar tot -1 pune

Link to comment
Share on other sites

  • 0
15 hours ago, TheGodfather said:

Nu e neaparat sa fie 107, asta e valoarea pe care trebuie sa o puna pentru casa in care testez. De asta am pus 107 dar tot -1 pune

Daca vei iesi din casa atunci valorea va fi -1 daca nu iesi vezi sa nu fie ceva timer pentru actualizarea sa

Link to comment
Share on other sites

  • 0
Just now, iSorin[] said:

Daca vei iesi din casa atunci valorea va fi -1 daca nu iesi vezi sa nu fie ceva timer pentru actualizarea sa

si daca iei spawn dupa /sspecoff si nu te spawnezi in casa atunci valoarea tot -1 o sa fie.

Link to comment
Share on other sites

  • 0
1 hour ago, iSorin[] said:

Daca vei iesi din casa atunci valorea va fi -1 daca nu iesi vezi sa nu fie ceva timer pentru actualizarea sa

Nu este niciun timer. E ceva problema la una din comenzile /sspec sau /sspecoff

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.