Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×

Question

Posted

Problema intalnita (descriere):Poi asa, ma bag in jail si imi apare textdraw cu :eliberat in ... secunde si wanted scade in..., cand ies din jail ramane acel textdraw nu stiu de ce, sau cand primesc free de la un jucator sau /relase de la admin, ramane acel textdraw.
Ero(area / rile) / warning-(ul / urile):Nu
Liniile de cod / sursa / script-ul(obligatoriu): 

 

jailed[f] = TextDrawCreate(503.5 ,106, "Eliberat in: ~r~10");
        TextDrawLetterSize(jailed[f], 0.299999,1.200000);
        TextDrawAlignment(jailed[f], 2);
        TextDrawColor(jailed[f], -1);
        TextDrawSetShadow(jailed[f], 1);
        TextDrawSetOutline(jailed[f], 1);
        TextDrawBackgroundColor(jailed[f], 51);
        TextDrawFont(jailed[f], 2);
        TextDrawSetProportional(jailed[f], 1);

        wanted[f] = TextDrawCreate(503.5 ,106, "Wanted scade in: ~r~10");
        TextDrawLetterSize(wanted[f], 0.299999,1.200000);
        TextDrawAlignment(wanted[f], 2);
        TextDrawColor(wanted[f], -1);
        TextDrawSetShadow(wanted[f], 1);
        TextDrawSetOutline(wanted[f], 1);
        TextDrawBackgroundColor(wanted[f], 51);
        TextDrawFont(wanted[f], 2);
        TextDrawSetProportional(wanted[f], 1);

 

public jailtimer69()
{
    new string2[256];
    foreach(Player, x)
    {
        if(IsPlayerConnected(x))
           {
         if(playerVariables[x][pPrisonID] > 0)
               {
                playerVariables[x][pPrisonTime]--;

                if(playerVariables[x][pPrisonID])
                {
                    new userID = playerVariables[x][pPrisonTime];
                    format(string2,256, "Eliberat in: ~r~%d minute", userID / 60);
                    TextDrawSetString(jailed[x], string2);
                    TextDrawShowForPlayer(x, jailed[x]);
                }

                if(playerVariables[x][pPrisonTime] == 1 && playerVariables[x][pPrisonID] >= 1)
                {
                    playerVariables[x][pPrisonID] = 0;
                    playerVariables[x][pPrisonTime] = 0;
                    format(string2,256, "            ");
                    TextDrawSetString(jailed[x], string2);
                    TextDrawShowForPlayer(x, jailed[x]);
                    SendClientMessage(x, COLOR_WHITE, "Your time is up! You have been released from jail.");
                    SetPlayerPos(x, 1545.0101,-1676.0103,13.5595);
                    SetPlayerInterior(x, 0);
                }
            }
           }
    }
    return 1;
}

18 answers to this question

Recommended Posts

  • 0
  • 0
Posted

Imi poti spune mai concret, unde gasesc codul unde ma spawneaza si ce ar trebuii sa scriu defapt.

Codul e cumva asta? 

if(playerVariables[x][pPrisonTime] == 1 && playerVariables[x][pPrisonID] >= 1)
                {
                    playerVariables[x][pPrisonID] = 0;
                    playerVariables[x][pPrisonTime] = 0;
                    format(string2,256, "            ");
                    TextDrawSetString(jailed[x], string2);
                    TextDrawShowForPlayer(x, jailed[x]);
                    SendClientMessage(x, COLOR_WHITE, "Your time is up! You have been released from jail.");
                    SetPlayerPos(x, 1545.0101,-1676.0103,13.5595); ----?
                    SetPlayerInterior(x, 0);
                }
            }
           }
    }
    return 1;
}
  • 0
  • 0
Posted (edited)

Si unde ar trebuii sa pun hide cum trebuie sa scriu?

 

TextDrawHideForPlayer dar de aici nu mai stiu ce trebuie sa fac

Edited by gamercs98
  • 0
  • 0
  • 0
Posted
38 minutes ago, gamercs98 said:

Bun, ok dar atunci cand un cop da free inca ramane acel textdraw.

atunci la comanda /free adaugi textdrawhideforplayer(playa 

playa nu playerid, sau giveplayerid cum e cazul la comanda

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
  • 0
Posted (edited)

Mai exact unde?, scuze ca tot intreb dar nu reusesc si incerc macar daca nu a-s incerca ba iau warning ba eroare...

 

Spoiler

CMD:free(playerid, params[]){
    new id, amount, szDialogString[250];
    if(sscanf(params, "ui", id, amount)) return SCM(playerid, -1, "{00FF00}Folosire: {FFFFFF}/free [playerid] [price]");
    if(IsPlayerInRangeOfPlayer(playerid, id, 10.0))
    {
        if(playerVariables[playerid][pGroup] == 1 || playerVariables[playerid][pGroup] == 2 || playerVariables[playerid][pGroup] == 3 ||  playerVariables[playerid][pGroup] == 5)
        {
            if(playerVariables[playerid][pRobPoints] >= 3)
            {
                if(amount > 0 && amount < 500001)
                {
                    if(playerVariables[id][pMoney] > amount)
                    {
                        if(playerVariables[id][pPrisonTime] >= 1)
                        {
                            GetPlayerName(id, szPlayerName, MAX_PLAYER_NAME);
                            format(szMessage, sizeof(szMessage), "You offered %s a free, with a price of: %d$", szPlayerName, amount);
                            SCM(playerid, COLOR_LIGHTGREEN, szMessage);

                            GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);

                            SetPVarInt(id, "fID", playerid);
                            SetPVarInt(id, "fPrice", amount);
                            
                            format(szDialogString, 250, "%s is offering you a free at a price of $%d. Do you wish to accept?", szPlayerName, amount);
                            ShowPlayerDialog(id, DIALOG_FREE, DIALOG_STYLE_MSGBOX, ""SERVER_NAME" {FFFFFF}Free", szDialogString, "Accept", "Decline");
                        }
                        else return SCM(playerid, -1,"This player isn't in jail.");
                    }
                    else return SCM(playerid, -1,"This player doesn't have enough money.");
                }
                else return SCM(playerid, -1,"Pretul trebuie sa fie intre 1$ si 500.000$.");
            }
            else return SCM(playerid, -1,"Nu ai destule lawer points.");
        }
        else
        {
            SCM(playerid, -1, "You are not a cop!");
        }
    }
    else
    {
        SCM(playerid, -1, "You need to be near the player you wish to free!");
    }
    return 1;
}

Edited by gamercs98
  • 0
Posted (edited)

Iau warn "ingrosat cu negru", warning 202: number of arguments does not match definition

 

Spoiler

format(szMessage, sizeof(szMessage), "%s has accepted your free ($%d)", szPlayerName, price);
                        SCM(copid, COLOR_LIGHTGREEN, szMessage);
                        DeletePVar(playerid, "fID");
                        DeletePVar(playerid, "fPrice");
                        SetPlayerPos(playerid, 1546.2699,-1675.8907,13.5620);
                        TextDrawHideForPlayer(playerid);
                        SetPlayerInterior(playerid, 0);
                        SetPlayerVirtualWorld(playerid, 0);
                        SetPlayerHealthEx(playerid, 99);
                        SetPlayerArmourEx(playerid, 0.0);

Edited by gamercs98
  • 0
Posted (edited)

Eroare.  error 017: undefined symbol "f"

Textdraw

 

Spoiler

jailed[f] = TextDrawCreate(503.5 ,106, "Eliberat in: ~r~10");

        TextDrawLetterSize(jailed[f], 0.299999,1.200000);
        TextDrawAlignment(jailed[f], 2);
        TextDrawColor(jailed[f], -1);
        TextDrawSetShadow(jailed[f], 1);
        TextDrawSetOutline(jailed[f], 1);
        TextDrawBackgroundColor(jailed[f], 51);
        TextDrawFont(jailed[f], 2);
        TextDrawSetProportional(jailed[f], 1)
                        SCM(copid, COLOR_LIGHTGREEN, szMessage);
                        DeletePVar(playerid, "fID");
                        DeletePVar(playerid, "fPrice");
                        SetPlayerPos(playerid, 1546.2699,-1675.8907,13.5620);
                        TextDrawHideForPlayer(playerid,    jailed[f]);
                        SetPlayerInterior(playerid, 0);
                        SetPlayerVirtualWorld(playerid, 0);
                        SetPlayerHealthEx(playerid, 99);
                        SetPlayerArmourEx(playerid, 0.0);

Spoiler

format(szMessage, sizeof(szMessage), "%s has accepted your free ($%d)", szPlayerName, price);

Edited by gamercs98
  • 0
Posted (edited)

TextDrawShowForPlayer(playerid, wanted[f]); Eroare.

Uite textdraw.

 

   

wanted[f] = TextDrawCreate(503.5 ,106, "Wanted scade in: ~r~10");


        TextDrawLetterSize(wanted[f], 0.299999,1.200000);
        TextDrawAlignment(wanted[f], 2);
        TextDrawColor(wanted[f], -1);
        TextDrawSetShadow(wanted[f], 1);
        TextDrawSetOutline(wanted[f], 1);
        TextDrawBackgroundColor(wanted[f], 51);
        TextDrawFont(wanted[f], 2);
        TextDrawSetProportional(wanted[f], 1);
 
Edited by gamercs98
Guest
This topic is now closed to further replies.
×
×
  • 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.