i want this drag player to last car
CMD:drag(playerid,params[])
{
if(gTeam[playerid] == Swat)
{
new id, Float
,Float:y,Float:z,tname[MAX_PLAYER_NAME];
if(sscanf(params, "d", id)) return SendClientMessage(playerid, -1,"{ff0000}[USAGE]: {ffffff}/drag [ID]");
if(GetPlayerWantedLevel(id) >= 4)
{
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"{ff0000}[ERROR]: {ffffff}This player isn't online!");
if(playerid == id) return SendClientMessage(playerid, -1, "{ff0000}[ERROR]: {ffffff}You can't drag your self");
if(!IsPlayerAttachedObjectSlotUsed(id, 0)) return SendClientMessage(playerid,RED,"{ff0000}[ERROR]: {ffffff}The player must be cuffed to use this command on him.");
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInRangeOfPoint(id, 5.0, x, y, z))
{
if(IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, RED,"{ff0000}[ERROR]: {ffffff}This player is in vehicle, Try to get him out, then re-use the command.");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED,"{ff0000}[ERROR]: {ffffff}You must be in a vehcile to use this command.");
PutPlayerInVehicle(id, GetPlayerVehicleID(playerid), 1);
TogglePlayerControllable(id, 0);
GetPlayerName(id,tname,sizeof(tname));
format(Jstring,sizeof(Jstring)," {00FFFFFF}[SWAT COMMAND]:{ffffff} You have dragged the player: %s(%d) succesfully, take him to the check point.",tname,id);
SendClientMessage(playerid,SwatC,Jstring);
}
} else return SendClientMessage(playerid,-1,"{ff0000}[ERROR]: {ffffff}This player isn't wanted.");
} else return SendClientMessage(playerid, RED,"{ff0000}[ERROR]: {ffffff}You have to be in the S.W.A.T skin to use this command.");
return 1;
}