03.03.2011, 21:48
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
Untested.
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.