pawn Код:
if(strcmp(cmd, "/meternocarro", true) ==0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 1)
{
if(CopOnDuty[playerid] == 0)
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Nгo estбs em duty!");
}
if(PlayerCuffed[giveplayerid] == 0)
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "O suspeito precisa ser algemado antes de estar posto no carro!");
}
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Precisas estar fora do carro para por o suspeito lб dentro.");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
new carid = GetPlayerVehicleID(playerid);
tmp = strtok(cmdtext, idx);
if (!strlen(tmp))
return SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "/meternocarro [playerid/PartOfName] [seatid]");
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if (!strlen(tmp))
return SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "/meternocarro [playerid/PartOfName] [seatid]");
new seat = strval(tmp);
if(seat < 0 || seat > 3)
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "O seatid tem de ser entre 1 e 3");
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "0 - Condutor");
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "1 - Pendura");
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "2 - Passageiro");
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "3 - Passageiro");
return 1;
}
new suspect = GetClosestPlayer(playerid);
format(string, sizeof(string), "Foste detido pelo agente %s .", GetPlayerNameEx(playerid));
SendClientMessage(giveplayerid, COLOR_LIGHTYELLOW2, string);
format(string, sizeof(string), "Detes-te o suspeito %s .", GetPlayerNameEx(suspect));
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, string);
PlayerPlayerActionMessage(playerid,suspect,15.0," pega o suspeito e mete-o dentro do carro.");
GameTextForPlayer(giveplayerid, "~r~BUSTED", 2500, 3);
ClearAnimations(giveplayerid);
PutPlayerInVehicle(giveplayerid,carid,seat);
TogglePlayerControllable(giveplayerid, 0);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Precisas estar perto do teu carro!");
return 1;
}
}
else
{
format(string, sizeof(string), "%s nгo estб online", giveplayerid);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
}
return 1;
}