Cuff systems?
#1

is i possible to be able to make a cuffing system that enables players to run but not sprint nor drive? as that is more Realistic then breaking handcuffs.
Reply
#2

It's possible. You could check if their velocity on-foot was greater than a normal running speed and slow them down. And for the other, you could just make it to where they couldn't get in vehicles.
Reply
#3

Quote:
Originally Posted by Backwardsman97
Посмотреть сообщение
It's possible. You could check if their velocity on-foot was greater than a normal running speed and slow them down. And for the other, you could just make it to where they couldn't get in vehicles.
This would be rather hard to script though right...?
if so...
Sigh, now i gotta look for a fricken Beut scripter
Reply
#4

Just make a quick script to print your velocity while running (not sprinting) and check what it is. You can then build off of there.

pawn Код:
// This will print the velocity of the player
// Load this as a filterscript, go in-game and type /print
// Then run (without sprinting) to check the velocity
// Exit the game
// Look at the console for the results
// NOTE: You may want to run for a while so you can see the running results more than others
#include <a_samp>

public OnPlayerCommandText(playerid, cmdtext[])
{
   if(!strcmp(cmdtext, "/print", true) == 0)
   {
      SetTimerEx("Timer", 1000, 1, "i", playerid);
      return 1;
   }
   return 0;
}

forward Timer(playerid);
public Timer(playerid)
{
   new Float:X, Float:Y, Float:Z;
   GetPlayerVelocity(playerid, X, Y, Z);
   print("X: %0.2f | Y: %0.2f | Z: %0.2f", X, Y, Z);
   return 1;
}
After you retrieve the normal X Y and Z velocity of normal running, you can check if the player is cuffed and running at a higher velocity than that and reduce their velocity with SetPlayerVelocity.
Reply
#5

Quote:
Originally Posted by Grim_
Посмотреть сообщение
Just make a quick script to print your velocity while running (not sprinting) and check what it is. You can then build off of there.

After you retrieve the normal X Y and Z velocity of normal running, you can check if the player is cuffed and running at a higher velocity than that and reduce their velocity with SetPlayerVelocity.
Hmmm, when i compile i get 4 warnings
(11) : warning 213: tag mismatch
(24) : warning 202: number of arguments does not match definition
(24) : warning 202: number of arguments does not match definition
(24) : warning 202: number of arguments does not match definition

it doesn't work assuming cos of those errors.
Reply
#6

pawn Код:
// Line 11
if(!strcmp(cmdtext, "/print", true))

// Line 24
printf("X: %0.2f | Y: %0.2f | Z: %0.2f", X, Y, Z);
Reply
#7

Quote:
Originally Posted by Grim_
Посмотреть сообщение
pawn Код:
// Line 11
if(!strcmp(cmdtext, "/print", true))

// Line 24
printf("X: %0.2f | Y: %0.2f | Z: %0.2f", X, Y, Z);
ok, thanks that worked,



i run at an average of -0.11 Y
so how would i make the hand cuff scrip work by slowing the speed down?
Reply
#8

to disable players with cuffs to get in a car you can use something like this.

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if (Cuffed[playerid] == 1)
    {
        new string[128];
        new Float:x, Float:y, Float:z;
        format(string, sizeof(string), "you cant enter a vehicle with your cuffs on!");
        SendClientMessage(playerid, 0xFFFFFFFF, string);
        GetPlayerPos(playerid,x,y,z);
        return SetPlayerPos(playerid,x,y,z+3);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)