How could i manage to do this?
#6

Well, the code You prevented only puts the player in the exact same position as he was...
It's not keeping him there, and I think he meant something like "/kidnap [id]"..


Edit:

You should learn how to use sscanf if You don't already, It's a great function for using text/numbers or w/e after Your command, ex: /keepplayerinmyvehicle 8

pawn Код:
if(strcmp(cmdtext, "/command", true) == 0)
{
    new id = 0;
    if(sscanf(cmdtext, "d", id)) return SendClientMessage(playerid, 0xFFFFFFFF, "You need to enter an ID");
    if(GetPlayerVehicleID(id) != GetPlayerVehicleID(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "The player isn't in the same vehicle.");
    if(id == playerid) return SendClientMessage(playerid, 0xFFFFFFFF, "Can't tie yourself up");
    TogglePlayerControllable(id, false);
    new string[256], idName[MAX_PLAYER_NAME], playerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
    GetPlayerName(id, idName, MAX_PLAYER_NAME);
    format(string, sizeof(string), "You where tied up by %s.", playerName);
    SendClientMessage(id, 0xFFFFFFFF, string);
    format(string, sizeof(string), "You tied %s.", idName);
    return SendClientMessage(playerid, 0xFFFFFFFF, string);
}

Untested.
Reply


Messages In This Thread
How could i manage to do this? - by [NRP]Blade - 03.03.2011, 20:56
Re: How could i manage to do this? - by Antonio [G-RP] - 03.03.2011, 21:40
Re: How could i manage to do this? - by Lorrden - 03.03.2011, 21:43
Re: How could i manage to do this? - by Antonio [G-RP] - 03.03.2011, 21:45
Re: How could i manage to do this? - by Krx17 - 03.03.2011, 21:48
Re: How could i manage to do this? - by Lorrden - 03.03.2011, 21:48
Re: How could i manage to do this? - by Antonio [G-RP] - 03.03.2011, 21:49
Re: How could i manage to do this? - by Cameltoe - 03.03.2011, 21:53
Re: How could i manage to do this? - by Lorrden - 03.03.2011, 21:56
Re: How could i manage to do this? - by Cameltoe - 03.03.2011, 22:00

Forum Jump:


Users browsing this thread: 1 Guest(s)