Szerző Téma: Timer help!!!  (Megtekintve 1227 alkalommal)

Timer help!!!
« Dátum: 2011. Március 17. - 14:31:47 »
0 Show voters
Hello all...
Az lene kérdésem hogy hogyan lehetne megoldani azt hogy a Timerem interválját a Inputos dialogba irjam be? Pl.:
 

SetTimerEx( \"jail\", 60000, false, \"i\");

 
A 60000 helyett a dialog inputja......
Elõre is köszz

Nem elérhető nyE

  • 1745
    • Profil megtekintése
Timer help!!!
« Válasz #1 Dátum: 2011. Március 17. - 14:45:12 »
0 Show voters

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_JAIL)
    {
        if(response)
        {
            SetTimerEx( \"jail\", inputtext, false, \"i\");
        }
    }
    return 1;
}

Timer help!!!
« Válasz #2 Dátum: 2011. Március 17. - 15:02:11 »
0 Show voters
C:\\Users\\Mimi\\Desktop\\03c\\filterscripts\\POL.pwn(111) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664           Copyright © 1997-2006, ITB CompuPhase
1 Error.
Ötlet?
« Utoljára szerkesztve: 2011. Március 17. - 15:04:33 írta miroslavbrnic »

Nem elérhető nyE

  • 1745
    • Profil megtekintése
Timer help!!!
« Válasz #3 Dátum: 2011. Március 17. - 15:09:13 »
0 Show voters
Idézetet írta: Antonyo date=1300369512\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"6908\" data-ipsquote-contentclass=\"forums_Topic


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_JAIL)
    {
        if(response)
        {
            SetTimerEx( \"jail\", strlen(inputtext), false, \"i\");
        }
    }
    return 1;
}

 

Elnéztem... de javítom.

Timer help!!!
« Válasz #4 Dátum: 2011. Március 17. - 15:30:36 »
0 Show voters
Jaj még nem zárok...
Azthittem megtom oldani.Az kéne ha letelik a timer ezeket csinálja
 

                            new name[MAX_PLAYER_NAME],string[200];
GetPlayerName(giveplayerid, name, sizeof(name));
format(string, sizeof string, \"%s kiszabadult a börtönbol!\", name);
        SendClientMessageToAll(0xB3D5B2AA,string);
        SetPlayerInterior(giveplayerid, 0);
        TogglePlayerControllable(giveplayerid,1);

 
Mert nekem nemvárja meg hogy a TIMER leteljen hanem röktön elkezdi,.....
« Utoljára szerkesztve: 2011. Március 17. - 15:32:47 írta miroslavbrnic »

Nem elérhető nyE

  • 1745
    • Profil megtekintése
Timer help!!!
« Válasz #5 Dátum: 2011. Március 17. - 17:10:28 »
0 Show voters
Mert millimásidpercben (vagy miben) adod meg.
Így próbáld:
 

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_JAIL)
    {
        if(response)
        {
            SetTimerEx( \"jail\", strlen(inputtext) * 1000, false, \"i\"); // beszrozzuk a beírt összeget 1000-el
        }
    }
    return 1;
}

 
Így mostmár másodpercben adod meg.


Ez pedig a kiszabadulás:
 

public jail(playerid);
public jail(playerid)
{
    new name[MAX_PLAYER_NAME],string[200];
    GetPlayerName(giveplayerid, name, sizeof(name));
    format(string, sizeof string, \"%s kiszabadult a börtönbol!\", name);
    SendClientMessageToAll(0xB3D5B2AA,string);
    SetPlayerInterior(giveplayerid, 0);
    TogglePlayerControllable(giveplayerid,1);
    return 1;
}

Nem elérhető DrAkE

  • 2078
    • Profil megtekintése
Timer help!!!
« Válasz #6 Dátum: 2011. Március 17. - 18:54:08 »
0 Show voters
Igazság szerint:
 
strlen(inputtext)

 
helyett:
 
strval(inputtext)

 
Mivel az strlen az csak megszámolja mennyi karakterbõl áll, és ha pl beírja a dialogba hogy 60000 akkor a timer csak 5 ms-ig tart.

Timer help!!!
« Válasz #7 Dátum: 2011. Március 17. - 19:09:21 »
0 Show voters
Kösz mostmár zárok

Nem elérhető nyE

  • 1745
    • Profil megtekintése
Timer help!!!
« Válasz #8 Dátum: 2011. Március 17. - 19:45:28 »
0 Show voters
Akkor zárj is :)

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal