27.12.2015, 12:20
Код:
CMD:getgift(playerid, params[]) // in your commands { if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first."); { new currenttime = gettime(); if(currenttime < (giftCooldown[playerid] + 6480)) return SendClientMessage(playerid, COLOR_GREY, "Wait before using the command again"); if(!IsPlayerInRangeOfPoint(playerid, 7.0, 1022.8253, -1853.5532, 13.5724)) return SendClientMessage(playerid, COLOR_GREY, "You are not at /getgift location."); SCM(playerid,COLOR_WHITE,"{FFFF00}You received 5000$ as a Christmas Gift."); new moneyToGive, string[88]; moneyToGive = randomEx(1000, 10000); GivePlayerCash(playerid, moneyToGive); format(string, sizeof(string), "{B7B7B7}[SERVER] {FFFFFF}You received %i as gift, merry christmas", moneyToGive); SendClientMessage(playerid, -1, string); Update(playerid, pCashx); giftCooldown[playerid] = gettime(); } return 1; }