Help to fix my problem
#2

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;
    }
12 in-game hours or real hours?

replace
Код:
ContractWait[playerid] < 1000*60*12
with
Код:
ContractWait[playerid] < 1000*60*720
for 12 real hours or any amount
Reply


Messages In This Thread
Help to fix my problem - by keyvanik - 05.06.2015, 20:20
Re: Help to fix my problem - by Nubik - 05.06.2015, 20:41
Re: Help to fix my problem - by keyvanik - 05.06.2015, 21:01
Re: Help to fix my problem - by keyvanik - 06.06.2015, 06:22
Re: Help to fix my problem - by Dangjai - 06.06.2015, 06:27
Re: Help to fix my problem - by keyvanik - 06.06.2015, 07:09

Forum Jump:


Users browsing this thread: 1 Guest(s)