if(isnull(params) || !(0 < strval(params) < 24)) SendClientMessage(playerid, COLOR_RED, "[ERROR]: Syntax: /Time [0 - 24]");
if ( isnull ( params ) ) return SendClientMessage( playerid, -1, #[ERROR]: Syntax: /Time [0 - 24] );
// if the parameters string are null return the above message
if ( strval ( params ) > 24 || strval ( params ) < 0 ) return SendClientMessage( playerid -1, #[ERROR]: 0 - 24 );
// strval converts a string to an integer, if params higher then 24 or lower then 0 return the above message
SetPlayerTime(playerid, 0, 0);
SetPlayerTime(playerid, 1, 0);
/*More*/
SetPlayerTime(playerid, 12, 0);
/*More*/
SetPlayerTime(playerid, 24, 0);
if ( isnull ( params ) ) return SendClientMessage( playerid, -1, #[ERROR]: Syntax: /Time [0 - 24] );
if ( strval ( params ) > 24 || strval ( params ) < 0 ) return SendClientMessage( playerid -1, #[ERROR]: 0 - 24 );
SetPlayerTime( playerid, strval ( params ), 0 );
error 035: argument type mismatch (argument 2)
CMD:time(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid, -1, "[ERROR]: Syntax: /Time [0-24]");
if(strval(params) > 24 || strval (params) < 0) return SendClientMessage(playerid -1, "[ERROR]: 0 - 24");//This Line
SetPlayerTime(playerid,strval(params), 0);
SetPlayerTime(playerid,strval(params), 1);
SetPlayerTime(playerid,strval(params), 2);
SetPlayerTime(playerid,strval(params), 3);
SetPlayerTime(playerid,strval(params), 4);
SetPlayerTime(playerid,strval(params), 5);
SetPlayerTime(playerid,strval(params), 6);
SetPlayerTime(playerid,strval(params), 7);
SetPlayerTime(playerid,strval(params), 8);
SetPlayerTime(playerid,strval(params), 9);
SetPlayerTime(playerid,strval(params), 10);
SetPlayerTime(playerid,strval(params), 11);
SetPlayerTime(playerid,strval(params), 12);
SetPlayerTime(playerid,strval(params), 13);
SetPlayerTime(playerid,strval(params), 14);
SetPlayerTime(playerid,strval(params), 15);
SetPlayerTime(playerid,strval(params), 16);
SetPlayerTime(playerid,strval(params), 17);
SetPlayerTime(playerid,strval(params), 18);
SetPlayerTime(playerid,strval(params), 19);
SetPlayerTime(playerid,strval(params), 20);
SetPlayerTime(playerid,strval(params), 21);
SetPlayerTime(playerid,strval(params), 22);
SetPlayerTime(playerid,strval(params), 23);
SetPlayerTime(playerid,strval(params), 24);
return 1;
}
playerid -1,
playerid, -1,
CMD:time( playerid, params[ ] ) { if( isnull( params ) ) return SendClientMessage( playerid, -1, "[ERROR]: Syntax: /Time [0-24]" ); if( strval( params ) > 24 || strval ( params ) < 0 ) return SendClientMessage( playerid, -1, "[ERROR]: 0 - 24" ); SetPlayerTime( playerid, strval( params ), 0 ); return 1; }
Change with this:
Код:
CMD:time( playerid, params[ ] ) { if( isnull( params ) ) return SendClientMessage( playerid, -1, "[ERROR]: Syntax: /Time [0-24]" ); if( strval( params ) > 24 || strval ( params ) < 0 ) return SendClientMessage( playerid, -1, "[ERROR]: 0 - 24" ); SetPlayerTime( playerid, strval( params ), 0 ); return 1; } |