26.01.2013, 17:57
Well title says all, the command drag wont work!
I hope you can fix it
Regards,
Gortex
pawn Код:
if(strcmp(cmd, "/detain", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsACop(playerid) || IsAnAgent(playerid) || IsASoldier(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " Cannot use this while being in the Car !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /detain [playerid/PartOfName] [seatid]");
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /detain [playerid/PartOfName] [seatid]");
new seat = strvalEx(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(seat < 1 || seat > 3)
{
SendClientMessage(playerid, COLOR_GREY, " Seat cannot be below 1 or above 3 !");
return 1;
}
if(IsACop(giveplayerid))
{
SendClientMessage(playerid, COLOR_GREY, " You can't Detain Cops !");
return 1;
}
if(IsPlayerInAnyVehicle(giveplayerid))
{
SendClientMessage(playerid, COLOR_GREY, " Suspect is in a Car, get him out first !");
return 1;
}
if(ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, " You cannot Detain yourself !"); return 1; }
if(PlayerCuffed[giveplayerid] == 2)
{
new carid = gLastCar[playerid];
if(IsInvalidDetainVehicle(carid)) { SendClientMessage(playerid, COLOR_GREY, " You can't Detain someone in that vehicle !"); return 1; }
//foreach(Player, i)
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerInAnyVehicle(i))
{
if(GetPlayerVehicleID(i) == gLastCar[playerid])
{
if(GetPlayerVehicleSeat(i) == seat)
{
format(string, sizeof(string), " That seat is occupied by %s !", PlayerName(i));
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
}
}
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* You were detained by %s.", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
if(PlayerInfo[giveplayerid][pMask] == 1)
{
format(string, sizeof(string), "* You have detained A Stranger.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s grabs A Stranger and throws him in his car.", PlayerName(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
format(string, sizeof(string), "* You have detained %s.", PlayerName(giveplayerid));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s grabs %s and throws him in the car.", sendername, PlayerName(giveplayerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
GameTextForPlayer(giveplayerid, "~r~Detained", 2500, 3);
ClearAnimations(giveplayerid);
TogglePlayerControllable(giveplayerid, 0);
if(IsInvalidDetainSeat(carid))
{
PutPlayerInVehicle(giveplayerid,carid,1);
}
else
{
PutPlayerInVehicle(giveplayerid,carid,seat);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player needs to be restrained first !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is not near you !");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is Offline !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not a member of the LSPD / SASD / FBI !");
}
}
return 1;
}
Regards,
Gortex