20.02.2009, 14:15
Hi,
Here is a Command for Rcon:
Regards,
- LJ
Here is a Command for Rcon:
pawn Код:
dcmd(settime, 7, cmdtext);
pawn Код:
dcmd_settime(playerid,params[])
{
new string[256],idx,tmp[256];
if(IsPlayerAdmin(playerid))
{
tmp = strtok(params,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_RED, "ERROR: /settime [hour]");
return 1;
}
new h = strval(tmp);
if(h < 0 || h > 24)
{
SendClientMessage(playerid, COLOR_RED, "ERROR: /settime [hour]");
return 1;
}
SetWorldTime(h);
format(string,sizeof(string), "Admin %s has change the Time to %d !", GetName(playerid), h);
SendAllEMessage(string);
}
else
{
SendClientMessage(playerid, COLOR_RED, "ERROR: You must be a Admin to use this Command !");
return 1;
}
return 1;
}
pawn Код:
stock GetName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
return name;
}
- LJ