05.06.2015, 21:01
Quote:
Is this what you're talking about?
Код:
new ContractWait[MAX_PLAYERS]; // at the top of your script if(strcmp(cmd, "/contract", true) == 0) { if(GetTickCount() - ContractWait[playerid] < 1000*60*12) { SendClientMessage(playerid, COLOR_RED, "Please wait before contracting again."); return 1; } if(PINFO[playerid][pMember] == 8 || PINFO[playerid][pLeader] == 8) return SCM(playerid,COLOR_ALI,"You can't use contract when you are a hitman agent."); if(PINFO[playerid][pLevel] < 3) return SCM(playerid,COL_SYN,"You need to have higher than 3 level to place a contract."); tmp = strtok(cmdtext,idx); if(!strlen(tmp)) return SCM(playerid,COL_SYN,"Syntax: /contract <PlayerID/PartOfName> <Prize>"); new taraf = ReturnUser(tmp); if(!IsPlayerConnected(taraf)) return SCM(playerid,COLOR_ALI,"That player is offline."); if(PINFO[taraf][pMember] == 8 || PINFO[taraf][pLeader] == 8) return SCM(playerid,COLOR_ALI,"You cannot contract a hitman agent."); tmp = strtok(cmdtext,idx); if(!strlen(tmp)) return SCM(playerid,COL_SYN,"Syntax: /contract <PlayerID/PartOfName> <Prize>"); new prize = strval(tmp); if(prize < 500 || prize > 10000) return SCM(playerid,COLOR_ALI,"Type a Prize number between $500 and $10,000"); if(prize > GetPlayerPool(playerid)) return SCM(playerid,COLOR_ALI,"You haven't this cash."); if(prize < 3500 && gTeam[taraf] == TEAM_COP) return SCM(playerid,COLOR_ALI,"The cash to contract a cop must be higher than $3,500."); GivePlayerPool(playerid,-prize); if(PINFO[taraf][pHeadValue] <= 0) { ContractsCount ++; ContractID[taraf] = ReturnContractID(); ContractIDUsed[ReturnContractID()] = true; AgentHiterID[taraf] = INVALID_PLAYER_ID; } PINFO[taraf][pHeadValue] += prize; SaveKonVal(taraf, "pHeadValue", PINFO[taraf][pHeadValue]); SCM(playerid,COLOR_ALI,"Player get contracted successfully."); ContractWait[playerid] = GetTickCount(); return 1; } replace Код:
ContractWait[playerid] < 1000*60*12 Код:
ContractWait[playerid] < 1000*60*720 |