Small help
#1

I created a /drag command for my law org. But when i cuff the player then try to drag them, it tells me that the player needs to be cuffed.

Drag command:
pawn Код:
COMMAND:drag(playerid, params[])
{
    new id,playerState = GetPlayerState(playerid),vehicleid = GetPlayerVehicleID(playerid);
    if(sscanf(params,"u", id))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /drag [id]");
    if(Member[playerid] == 0)return SendClientMessage(playerid,red, "You are not in a law org.");
    if(Cuffed[id] == 0) return SendClientMessage(playerid,red, "The player needs to be cuffed.");
    if(playerState == PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,red, "You are not in a vehicle");
    if(playerState == PLAYER_STATE_DRIVER){
    }PutPlayerInVehicle(id, vehicleid, 3);
    GetPlayerName(playerid,String,sizeof(String));
    format(String,sizeof(String),"You have been draged into a vehicle buy a %s",pname);
    return 1;
}
Cuff Command:
pawn Код:
COMMAND:cuff(playerid, params[])
{
    new id,Name[MAX_PLAYER_NAME],pskin = GetPlayerSkin(playerid);
    new playerState = GetPlayerState(id);
    if(pskin == 265 || pskin == 266 || pskin == 267 || pskin == 280 || pskin == 282|| pskin == 281 || pskin == 284 || pskin == 285 || pskin == 286 || pskin == 287 || pskin == 288){
    if(sscanf(params,"u", id))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /cuff [id]");
    if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found.");
    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xC0C0C0FF,"**You can't cuff someone from a vehicle.");
     if(id == playerid)return SendClientMessage(playerid,0xC0C0C0FF,"**You cannot cuff yourself.");
    if(GetDistanceBetweenPlayers(playerid,id)> 2)return SendClientMessage(playerid,0xC0C0C0FF,"You are to far from that player");
    if(playerState == PLAYER_STATE_PASSENGER || playerState == PLAYER_STATE_DRIVER)return SendClientMessage(playerid,0xC0C0C0FF,"**You can't cuff someone who is in a vehicle.");
    }else return SendClientMessage(playerid,0xC0C0C0FF,"You dont have permisson to access this command.");
    {
    TogglePlayerControllable(id,false);
    }
    {
    GetPlayerName(playerid, Name, sizeof(Name));
    format(String, sizeof(String), "You have been restrained in handcuffs by %s.",Name);
    SendClientMessage(id,0xFF8000FF,String);
    }
    Cuffed[id] = 1;
    return 1;
}
Reply
#2

Nvm i fixed it.
Reply
#3

mind that

format(String,sizeof(String),"You have been draged into a vehicle buy a %s",pname);

is

format(String,sizeof(String),"You have been draged into a vehicle by a %s",pname);

Reply
#4

You have been dragged into a vehicle by %s...

You don't call a person "a <name here>" ..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)