16.11.2011, 13:40
Код:
if(strcmp(cmd, "/sleep", true) == 0) { if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pLevel] >= 2) { new TickCount[MAX_PLAYERS]; if(GetTickCount() - TickCount[playerid] < 20000) { SendClientMessage(playerid, COLOR_GRAD1, "Please wait 20 seconds. To relax again."); return 1; } TickCount[playerid] = GetTickCount(); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string),"* %s The bed rest", sendername); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); SetPlayerHealth(playerid, 100); ApplyAnimation(playerid,"PED","KO_skid_front",4.1,0,1,1,1,0); format(string, sizeof(string),"* %s The bed rest.", sendername); } else { SendClientMessage(playerid, COLOR_GRAD1, " You must have a Level 2.!"); } } return 1; }