07.10.2012, 01:01
pawn Код:
if(strcmp(cmd, "/drag", true) == 0) // by LordMan
{
if(IsPlayerConnected(playerid))
{
if(!IsACop(playerid))
{
SendClientMessage(playerid, COLOR_GRAD1, "You are not a cop!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /drag [playerid/PartOfName]");
return 1;
}
if(PlayerInfo[playerid][pDBanned] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "** You are Banned From Cop Duty!");
return 1;
}
new newcar = GetPlayerVehicleID(playerid);
new playa;
playa = ReturnUser(tmp);
if(IsACopCar(newcar) || IsNgCar(newcar))
{
return SendClientMessage(playerid, COLOR_GRAD1, "You are not in police vehicle!");
}
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playa,x,y,z);
if(IsPlayerInRangeOfPoint(playerid, 5, x, y, z))
{
PutPlayerInVehicle(playa,newcar,1);
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* %s drags %s to his/her car/moped.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
new y1, m, d;
new h,mi,s;
getdate(y1,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /drag %s",d,m,y1,h,mi,s,sendername,giveplayer);
CommandLog(string);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Player is not near you.");
}
}
}
}
return 1;
}