command(time, playerid, params[])
{
#pragma unused params
if( Player[playerid][Cuffed] >= 1 || Player[playerid][Tazed] >= 1 || Player[playerid][IsAtEvent] >= 1 )
{
SendClientMessage( playerid, WHITE, "You're unable to execute this right now." );
}
else
{
new string[ 128 ], hour, minute, second;
gettime( hour, minute, second );
format( string, sizeof( string ), "The current server time is %d:%d:%d ", hour, minute, second );
SendClientMessage( playerid, WHITE, string );
if( Player[i][PrisonDuration] >= 1)
{
new string[ 128 ];
Player[i][PrisonDuration]--;
format( string, sizeof( string ), "~n~~n~~n~~n~~n~~n~~n~ ~R~%d seconds (%d minutes)", Player[i][PrisonDuration], SecondsToMinutes( Player[i][PrisonDuration]) );
SendClientMessage( playerid, GREY, string );
}
|
Looks ok so far. What is the problem with it? Worng output, errors?
|
: error 017: undefined symbol "i" : error 017: undefined symbol "i" : error 017: undefined symbol "i" 3 Errors.
|
Ah, didnt see that.
Do you use a timer to decrease the prison time? (Id guess so) If yes, you can just replace the 'i's with playerid and remove that line Player[i][PrisonDuration]--; It would decrease the time each time it is checked. btw: ~n~ and ~r~ do not work in ClientMessages, only in TextDraws or gametexts |