20.02.2009, 17:53
Quote:
Originally Posted by [MLT
Marco ]
ok thanks but where should i put it? under what i mean? |
pawn Код:
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
pawn Код:
dcmd_settime(playerid,params[])
{
if ( !IsPlayerAdmin( playerid ) ) return SendClientMessage( playerid, COLOR_RED, "ERROR: You must be a Admin to use this Command !" );
if ( !params[ 0 ] ) return SendClientMessage( playerid, COLOR_RED, "ERROR: /settime [hour]" );
if ( !IsNumeric( params ) ) return SendClientMessage( playerid, COLOR_RED, "ERROR: The 'hour' parameter must be numerical" );
new
string[ 70 ],
h = strval( params );
if ( h < 0 || h > 24 ) return SendClientMessage( playerid, COLOR_RED, "ERROR: Use a number from 0 to 24" );
SetWorldTime( h );
format( string, sizeof( string ), "Admin %s has change the Time to %d !", GetName(playerid), h );
SendClientMessageToAll( COLOR_HERE?????, string );
return 1;
}
pawn Код:
stock GetName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
return name;
}
stock IsNumeric(const string[])
{
for (new i = 0, j = strlen(string); i < j; i++)
{
if (string[i] > '9' || string[i] < '0') return 0;
}
return 1;
}
pawn Код:
dcmd(settime, 7, cmdtext);
Quote:
Originally Posted by ★ ♫ • Littlejohny • ♫ ★
Quote:
- LJ |
Quote:
Originally Posted by Daren_Jacobson
that is a function, put it at the bottom, and put the dcmd(settime, 7, cmdtext); thing in OnPlayerCommandText
note:you must have pawn Код:
|