CNR Scripts
#4

Taze
PHP код:
dcmd_taze(playeridparams[])
{
    if(
gTeam[playerid] == TEAM_COP || gTeam[playerid] == TEAM_AIRCOP || gTeam[playerid] == TEAM_MARINECOP || gTeam[playerid] == TEAM_SWAT || gTeam[playerid] == TEAM_ARMY)
    {
        new 
targetidstring[128];
        new 
playername[MAX_PLAYER_NAME], targetname[MAX_PLAYER_NAME];
        
GetPlayerName(playeridplayernamesizeof(playername));
        
GetPlayerName(targetidtargetnamesizeof(targetname));
        if(
sscanf(params"u"targetid)) return SendClientMessage(playeridCOLOR_USAGE"USAGE: /taze (id)");
        else if(
gTeam[targetid] == TEAM_COP && gTeam[targetid] == TEAM_AIRCOP && gTeam[targetid] == TEAM_MARINECOP && gTeam[targetid] == TEAM_SWAT && gTeam[targetid] == TEAM_ARMY) return SendClientMessage(playeridCOLOR_ERROR"You cannot taze another Law Enforcement agent");
        else if(
targetid == INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_ERROR"Invalid ID");
        else if(
playerid == targetid) return SendClientMessage(playeridCOLOR_ERROR"You cannot taze yourself!");
        else if(
IsSpawned[playerid] == 0) return SendClientMessage(playeridCOLOR_ERROR"You are dead. You cannot use this command");
        else if(
Jailed[playerid] == 1) return SendClientMessage(playeridCOLOR_ERROR"You cannot use this command in jail");
        else if(
GetPlayerWantedLevel(targetid) <= 3)
        {
            
format(stringsizeof(string), "%s(%d) Does not have a warrant. You cannot use your tazer on this player"targetnametargetid);
            
SendClientMessage(playeridCOLOR_ERRORstring);
            return 
1;
        }
        else if(
Tazed[targetid] == 1)
        {
            
format(stringsizeof(string), "%s(%d) Is being tazed right now. You cannot taze a player while the player is being tazed"targetnametargetid);
            
SendClientMessage(playeridCOLOR_ERRORstring);
        }
        else if(
GetDistanceBetweenPlayers(playeridtargetid) > 10)
        {
            
format(stringsizeof(string), "%s(%d) Is not close enough to taze"targetnametargetid);
            
SendClientMessage(playeridCOLOR_ERRORstring);
            return 
1;
        }
        else if(
Cuffed[targetid] == 1)
        {
            
format(stringsizeof(string), "%s(%d) Is in handcuffs and is restrained. You cannot taze a handcuffed player"targetnametargetid);
            
SendClientMessage(playeridCOLOR_ERRORstring);
            return 
1;
        }
        else if(
IsPlayerInAnyVehicle(targetid))
        {
            
format(stringsizeof(string), "%s(%d) Is in a vehicle. Get the player out the vehicle then use your tazer"targetnametargetid);
            
SendClientMessage(playeridCOLOR_ERRORstring);
            return 
1;
        }
        else if(
IsPlayerInAnyVehicle(playerid))
        {
            
SendClientMessage(playeridCOLOR_ERROR"You cannot taze a player from inside a vehicle");
            return 
1;
        }
        else
        {
            new 
FileL[68];
            
format(FileLsizeof(FileL) , SERVER_USER_FILE playername);
            
dini_IntSet(FileL"Taze" UserInfo[playerid][Taze]);
            
UserInfo[playerid][Taze] ++;
            
Tazed[targetid] =1;
            
TogglePlayerControllable(targetid0);
            
format(stringsizeof(string), "Law Enforcement agent %s(%d) Has tazed suspect %s(%d)"playernameplayeridtargetnametargetid);
            
SendClientMessageToAll(0x00C7FFAAstring);
            
format(stringsizeof(string), "Officer %s(%d) Has tazed you"playernameplayerid);
            
SendClientMessage(targetidCOLOR_DODGERBLUEstring);
            
ApplyAnimation(targetid,"PED","BIKE_fall_off",4.1,0,1,1,1,1);
            
SetTimer("Tazingtime"3000false);
            return 
1;
        }
    }
    return 
0;

Cuff
PHP код:
if(strcmp(cmd"/cuff"true) == 0)
    {
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp))
        {
            
SendClientMessage(playeridCOLOR_GREY"USAGE: /cuff [playerid]");
        }
        
giveplayerid strval(tmp);
        new 
Float:xFloat:yFloat:z;
        
GetPlayerPos(playeridxyz);
        if(
gTeam[playerid] == TEAM_COP && PlayerInfo[playerid][pRank] == || gTeam[playerid] == TEAM_ARMY && PlayerInfo[playerid][pRank] == 2)
        {
            if(
PlayerToPoint(7.5giveplayeridyz))
            {
                if(
gTeam[playerid] == TEAM_COP && PlayerInfo[playerid][pRank] == || gTeam[playerid] == TEAM_ARMY && PlayerInfo[playerid][pRank] == && IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 104)
                {
                    
format(stringsizeof(string), "Officer %s has cuffed (suspect) %s"PlayerName[playerid], PlayerName[giveplayerid]);
                    
SendClientMessageToAll(COLOR_BLUEstring);
                    
TogglePlayerControllable(giveplayeridfalse);
                    return 
1;
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_RED"You could not cuff an officer that follows the law to.");
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_RED"That playerid is not close (enough) to you!");
            }
        }
        else
        {
            
SendClientMessage(playeridCOLOR_RED,"You are not a part of the cops team.");
        }
        return 
1;
    } 
Reply


Messages In This Thread
CNR Scripts - by MichaelProPlayer - 30.04.2012, 07:46
Re: CNR Scripts - by CrazyChoco - 30.04.2012, 20:41
AW: CNR Scripts - by Forbidden - 30.04.2012, 20:56
Re: CNR Scripts - by Squirrel - 30.04.2012, 21:12

Forum Jump:


Users browsing this thread: 3 Guest(s)