/bribe command help!
#10

test
PHP код:
COMMAND:bribe(playeridparams[])
{
    if (
PlayerInfo[playerid][pDead] == 0)
    {
        if (
PlayerInfo[playerid][pTeam] == TEAM_CIVILIAN && PlayerInfo[playerid][pVigilante] == 0)
        {
            new 
idx,amount,string[256],tmp[256];
            new 
Float:xFloat:yFloat:z;
            
GetPlayerPos(playeridxyz);
            
            
tmp strtok(paramsidx);
            if (!
strlen(tmp))
            {
                
amount 15000;
            }
            else
            {
                if (!
isNumeric(tmp))
                {
                    
SendClientMessage(playeridCOLOR_ERROR"Invalid Amount - Enter A Numerical Character.");
                    return 
1;
                }
                
amount strval(tmp);
            }
            
//permissions durring doing missions needed.
            
if (amount 15000 || amount 1000)
            {
                
format(stringsizeof(string), "Invalid Amount $%d - Minimum Bribe : $1000 Maximum Bribe: $15000",amount);
                
SendClientMessage(playerid,COLOR_ERRORstring);
                return 
1;
            }
            if (
PlayerInfo[playerid][pWantedLevel] > 8)
            {
                
SendClientMessage(playerid,COLOR_ERROR"You Are On The List Of Most Wanted Suspects.  You Cannot Bribe The Police.");
                return 
1;
            }
            if (
PlayerInfo[playerid][pBribeWaitTime] > 0)
            {
                
SendClientMessage(playeridCOLOR_ERROR"Please Wait Before Offering Another Bribe.");
                return 
1;
            }
            
            for(new 
0MAX_PLAYERSi++)
            {
                if (
PlayerInfo[i][pSkill] != SKILL_COP && PlayerInfo[playerid][pVigilante] == 0)
                {
                    
format(stringsizeof(string), "%s Is Not A Police Officer.",PlayerInfo[TargetId][pName]);
                    
SendClientMessage(playerid,COLOR_ERRORstring);
                    return 
1;
                }
                if(
IsPlayerInRangeOfPoint(i3.0x,y,z))
                {
                    
format(stringsizeof(string), "You Have Offered Officer %s (%d) A Bribe ($%d).  Wait To See If %s Will Accept.",PlayerInfo[i][pName],i,amount,SubjectGenderPronouns[PlayerInfo[i][pGender]]);
                    
SendClientMessage(playeridCOLOR_SERVER_HELP_MSGstring);
                    
format(stringsizeof(string), "~w~BRIBE OFFERED TO OFFICER %s"PlayerInfo[i][pName]);
                    
SendGameText(playeridstring30003);
                    
format(stringsizeof(string), "%s (%d) Has Offered You A Bribe ($%d). Type /accept Or /refuse.",PlayerInfo[playerid][pName],playerid,amount);
                    
SendClientMessage(i,COLOR_SERVER_HELP_MSGstring);
                    
format(stringsizeof(string), "~w~OFFERED A BRIBE BY %s~n~[$%d]~n~~y~TYPE /ACCEPT OR /REFUSE"PlayerInfo[playerid][pName],amount);
                    
SendGameText(istring30003);
                    
PlayerInfo[playerid][pBribe] = amount;
                    
PlayerInfo[playerid][pBribeWaitTime] = 30;
                    
PlayerInfo[playerid][pBribeOfferedTo] = i;
                    
PlayerInfo[i][pBribeOfferedBy] = playerid;
       
                }
            }
        }
        else
        
SendClientMessage(playeridCOLOR_ERROR"Only Civilians Can Use This Command.");
    }
    else
    
SendErrorMessage(playerid3);
    return 
1;

Reply


Messages In This Thread
/bribe command help! - by danish007 - 14.02.2015, 21:20
Re: /bribe command help! - by danish007 - 15.02.2015, 11:30
Re: /bribe command help! - by Ritzy2K - 15.02.2015, 11:46
Re: /bribe command help! - by Golf - 15.02.2015, 11:48
Re: /bribe command help! - by danish007 - 15.02.2015, 16:09
Re: /bribe command help! - by danish007 - 16.02.2015, 10:35
Re: /bribe command help! - by AndySedeyn - 16.02.2015, 10:55
Re: /bribe command help! - by danish007 - 16.02.2015, 16:03
Re: /bribe command help! - by danish007 - 17.02.2015, 15:14
Re: /bribe command help! - by Golf - 17.02.2015, 15:47

Forum Jump:


Users browsing this thread: 2 Guest(s)