21.01.2013, 11:16
pawn Код:
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;
}
Thanks