problem with command /settime
#1

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
Reply
#2

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

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

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);
Reply
#5

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

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

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)
Reply
#8

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);
Reply
#9

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
Reply
#10

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)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)