if(strcmp(cmd, "/detain", true) ==0) { if(IsPlayerConnected(playerid)) { if(gTeam[playerid] == 2 || IsACop(playerid)) { if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid, COLOR_GREY, " Cannot use this while being in the Car !"); return 1; } if(IsPlayerConnected(giveplayerid)) { if (ProxDetectorS(8.0, playerid, giveplayerid)) { new carid = gLastCar[playerid]; 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 = strval(tmp); if(seat < 0 || seat > 3) { SendClientMessage(playerid, COLOR_GRAD1, "The seat ID cannot be above 3 or below 1."); 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); format(string, sizeof(string), "* You detained %s .", giveplayer); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* %s grabs %s and throws him in his car.", sendername ,giveplayer); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); GameTextForPlayer(giveplayerid, "~r~BUSTED", 2500, 3); ClearAnimations(giveplayerid); TogglePlayerControllable(giveplayerid, 0); PutPlayerInVehicle(giveplayerid,carid,seat); PlayerCuffed[giveplayerid] = 2; PlayerCuffedTime[giveplayerid] = 99999999; } else { SendClientMessage(playerid, COLOR_GREY, " You are not close to your last car"); return 1; } } } else { SendClientMessage(playerid, COLOR_GREY, " You are not a Cop / FBI / National Guard !"); } }//not connected return 1; }
Originally Posted by Miokie*
im guessing this is for Pen or GF? Ask in the appropriate topic.
|