SA-MP Forums Archive
problem with command /settime - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: problem with command /settime (/showthread.php?tid=427832)



problem with command /settime - toi - 03.04.2013

hello, this server command to change the 'now just me
On top of all:
Код:
#define MyTime 1008
then the command:
Код:
CMD:hour(playerid,params[])
{
ShowPlayerDialog(playerid, MyTime, DIALOG_STYLE_INPUT, "{C3C3C3}Hour", "{FFFFFF}insert your hour", "Ok", "Cancel");
return 1;
}
then I put this under OnDialogResponse:
Код:
if(dialogid == MyTime)
{
	    if ( response )
	    {
	        new Time;
	        if ( sscanf( inputtext, "d", Time ) )
                    Time = strval(inputtext);
                    {
                    SetPlayerTime(playerid, Time);
                    }
             }
}
but the server crashes, where am I wrong?
Tanks


Re: problem with command /settime - brawrr - 03.04.2013

try use func SetWorldTime(MyTime); and MyTime 0-24


Re: problem with command /settime - Windrush - 03.04.2013

pawn Код:
if(dialogid == MyTime)
{
        if ( response )
        {
                    {
                    SetPlayerTime(playerid,   inputtext);
                    }
             }
}



Re: problem with command /settime - toi - 03.04.2013

Quote:
Originally Posted by windrush
Посмотреть сообщение
pawn Код:
if(dialogid == MyTime)
{
        if ( response )
        {
                    {
                    SetPlayerTime(playerid,   inputtext);
                    }
             }
}
1 error
Код:
C:\Users\----\Desktop\NEW GM ZCMD\NEW GM\gamemodes\pss.pwn(7148) : error 035: argument type mismatch (argument 2)
line 7148:
Код:
SetPlayerTime(playerid,   inputtext);



Re: problem with command /settime - Spose - 03.04.2013

Does the samp-server.exe crash, or does your script not compile?


Re: problem with command /settime - Windrush - 03.04.2013

pawn Код:
if(dialogid == MyTime)
{
if ( response )
{
SetPlayerTime(playerid,   inputtext);
}
}



Re: problem with command /settime - toi - 03.04.2013

Quote:
Originally Posted by windrush
Посмотреть сообщение
pawn Код:
if(dialogid == MyTime)
{
if ( response )
{
SetPlayerTime(playerid,   inputtext);
}
}
Same error, same line
Код:
C:\Users\----\Desktop\NEW GM ZCMD\NEW GM\gamemodes\tss.pwn(7147) : error 035: argument type mismatch (argument 2)



Re: problem with command /settime - L.Hudson - 03.04.2013

The SetPlayerTime includes the (playerid, hours, minutes) so you get an argument mistype cuz u missed the minutes.

Try putting this
pawn Код:
SetPlayerTime(playerid, unputtext, 0);



Re: problem with command /settime - PinEvil - 03.04.2013

Try this:

Код:
CMD:settime( playerid, params[ ] )
{
    new time;
    if( sscanf( params, "i", time ) ) return SendClientMessage( playerid, 0xFFFFFFFF, "{FFFF00}Usage: /settime <0-24>" );
    if( time > 24 || time < 0 ) return SendClientMessage( playerid, 0xFFFFFFFF, "{FFFF00}Available Hours: 0-24" );
    SetPlayerTime(playerid,time,0 );
    return 1;
}
Instead of using a dialog box.

Code by: cjgogo


Re: problem with command /settime - toi - 03.04.2013

Quote:
Originally Posted by L.Hudson
Посмотреть сообщение
The SetPlayerTime includes the (playerid, hours, minutes) so you get an argument mistype cuz u missed the minutes.

Try putting this
pawn Код:
SetPlayerTime(playerid, unputtext, 0);
still the same problem:
Код:
C:\Users\----\Desktop\NEW GM ZCMD\NEW GM\gamemodes\tss.pwn(7147) : error 035: argument type mismatch (argument 2)