CNR Scripts
#1

Hello , Can someone tell me how to make these types of scripts :

1) /taze (playerid)
2) /cuff (playerid)
3) /arrest (playerid)
Reply
#2

if you donate to me i can
Reply
#3

This will be very easy.
Firstly:CrazyChoco you are retarded.
1) You can easily make a stock to freeze a Player.
TogglePlayerControllable(playerid,0); will freeze the player.
So you can use sscanf to make it a bit easier.

2)There is a new Function on sa-mp 0.3e , for this you must read the post from Kalcor.
3)For this you can use sscanf , then you just map a map or take a Position where the Player should teleport.
If you want that a player should be for 5 Minutes for example in a cell.
You can make a Timer (remember with params).

Like these Commands arenґt hard to script.
If you need help PM me.
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)