CMD:drag(playerid, params[])
{
new giveplayerid, giveplayer[MAX_PLAYER_NAME], sendername[MAX_PLAYER_NAME], string[128], DragOff[MAX_PLAYERS];
if(sscanf(params,"u",giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE,"USAGE: /drag [playerid]");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "That Player is offline !");
if(!ProxDetectorS(3.0, playerid, giveplayerid)) return SendClientMessage(playerid, COLOR_GREY,"That player isn't near you !");
if(DragOff[giveplayerid] > 0) return SendClientMessage(playerid, COLOR_GREY,"You are already being Dragged!");
if(giveplayerid == playerid) return SendClientMessage(playerid, COLOR_GREY, "You Cannot Drag Yourself!");
if(PlayerInfo[giveplayerid][pMember] == 1 || PlayerInfo[giveplayerid][pLeader] == 1)
{ return SendClientMessage(playerid, COLOR_GREY,"You can't drag cops"); }
if(PlayerInfo[giveplayerid][pMember] == 1 || PlayerInfo[giveplayerid][pLeader] == 1)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* You are being dragged by %s,", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* You begin to drag %s,", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s has started to drag %s.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
TogglePlayerControllable(giveplayerid, 0);
DragOff[giveplayerid] = playerid;
}
else return SendClientMessage(playerid, COLOR_GREY,"You are not a cop");
return 1;
}
pawn Код:
Thanks |
new pvehicleid = GetPlayerVehicleID(playerid)
if(pvehicleid == 427 || pvehicleid == 490 || pvehicleid == 596 || pvehicleid == 597 || pvehicleid == 598) //if it's a Enforcer, FBI Rancher, LSPD-, SFPD- or LVPD-Car
switch(random(2))
{
case 0: PutPlayerInVehicle(giveplayerid,pvehicleid,3);//back left passenger seat
case 1: PutPlayerInVehicle(giveplayerid,pvehicleid,4);//back right passenger seat
}
}
else if(pvehicleid == 423 || pvehicleid == 599) //if it's a HPV-1000 or Police Rancher
{
PutPlayerInVehicle(giveplayerid,pvehicleid,2);//second seat|front right
}
else return SendClientMessage(playerid,0xFF00FFFF,"You have to be in a Police vehicle to do this!");