CMD:createspike(playerid, params[])
{
new string[128], Float:Pos[4];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!IsACop(playerid) && !IsFBI(playerid) && !IsARES(playerid) && !IsAGov(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not a LEO.");
if(!PlayerInfo[playerid][pFacDuty]) return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
if(PlayerInfo[playerid][pFacRank] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command. (Rank 4+)");
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
GetPlayerFacingAngle(playerid,Pos[3]);
CreateStrip(x, y, z, angle);
format(string, sizeof(string), "BCPD: %s has created a spike strip.", RPN(playerid));
SendCopMessage(COLOR_BLUE, string);
ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,0,0,0,0,0); // Plant bomb
return 1;
}
CMD:removespike(playerid, params[])
{
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!IsACop(playerid) && !IsFBI(playerid) && !IsARES(playerid) && !IsAGov(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not a LEO.");
if(PlayerInfo[playerid][pFacRank] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command. (Rank 4+)");
DeleteClosestStrip(playerid);
return 1;
}
if(strcmp(cmd, "/deployspikes", true) == 0)
{
if(!IsACop(playerid) && !IsANG(playerid))
{
return SendClientMessage(playerid,COLOR_GREY,"You are not a Cop / FBI / SAST / NG.");
}
if(PlayerInfo[playerid][pMember] == 1)
{
if(PlayerInfo[playerid][pRank] < 4)
{
return SendClientMessage(playerid,COLOR_GREY,"Your rank is too low to be deploying spike strips.");
}
}
else
{
if(PlayerInfo[playerid][pRank] < 5)
{
return SendClientMessage(playerid,COLOR_GREY," Your rank is too low to be removing spike strips !");
}
}
if(IsPlayerInAnyVehicle(playerid))
{
return SendClientMessage(playerid,COLOR_GREY," You cannot place a spike strip while inside a vehicle !");
}
new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
GetPlayerPos(playerid,plocx,plocy,plocz);
GetPlayerFacingAngle(playerid,ploca);
new location[MAX_ZONE_NAME];
GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
new Float:x, Float:y, Float:z, Float:angle;
GetPlayerFacingAngle(playerid, angle);
GetPlayerPos(playerid, x, y, z);
CreateStrip(x, y, z, angle);
format(string, sizeof(string), "HQ: %s %s has placed a spike strip at %s", GetPlayerRank(playerid),PlayerName(playerid), location);
SendRadioMessage(1, TEAM_BLUE_COLOR, string);
SendRadioMessage(2, TEAM_BLUE_COLOR, string);
SendRadioMessage(3, TEAM_BLUE_COLOR, string);
SendRadioMessage(5, TEAM_BLUE_COLOR, string);
ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,0,0,0,0,0); // Plant bomb
/*GetPlayerFacingAngle(playerid,ploca);
CreateStrip(plocx,plocy,plocz,ploca);*/
return 1;
}
if(strcmp(cmd, "/deletespike", true) == 0)
{
if(!IsACop(playerid) && !IsANG(playerid))
{
return SendClientMessage(playerid,COLOR_GREY," You are not a Cop / FBI / SAST / NG !");
}
if(PlayerInfo[playerid][pMember] == 1)
{
if(PlayerInfo[playerid][pRank] < 4)
{
return SendClientMessage(playerid,COLOR_GREY," Your rank is too low to be removing spike strips !");
}
}
else
{
if(PlayerInfo[playerid][pRank] < 5)
{
return SendClientMessage(playerid,COLOR_GREY," Your rank is too low to be removing spike strips !");
}
}
DeleteClosestStrip(playerid);
return 1;
}
CMD:pregos(playerid, params[]){
#pragma unused params
new Float:Pregos[4], nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, nome, sizeof(nome));
CreateStrip(Pregos[0], Pregos[1], Pregos[2], Pregos[3]);
return 1;
}
Ficarб por sua conta as verificaзхes.
pawn Код:
|
CMD:createspike(playerid, params[])
{
new string[128], Float:Pos[4];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!IsACop(playerid) && !IsFBI(playerid) && !IsARES(playerid) && !IsAGov(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not a LEO.");
if(!PlayerInfo[playerid][pFacDuty]) return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
if(PlayerInfo[playerid][pFacRank] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command. (Rank 4+)");
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
GetPlayerFacingAngle(playerid,Pos[3]);
CreateStrip(Pos[0], Pos[1], Pos[2],Pos[3]);
format(string, sizeof(string), "BCPD: %s has created a spike strip.", RPN(playerid));
SendCopMessage(COLOR_BLUE, string);
return 1;
}
CMD:createspike(playerid, params[])
{
new string[128], Float:Pos[4];
if(!IsPlayerLoggedIn(playerid))
return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!IsACop(playerid) && !IsFBI(playerid) && !IsARES(playerid) && !IsAGov(playerid))
return SendClientMessage(playerid, COLOR_GREY, "You are not a LEO.");
if(!PlayerInfo[playerid][pFacDuty])
return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
if(PlayerInfo[playerid][pFacRank] < 4)
return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command. (Rank 4+)");
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
GetPlayerFacingAngle(playerid,Pos[3]);
CreateStrip(Pos[0], Pos[1], Pos[2], Pos[3]);
format(string, sizeof(string), "BCPD: %s has created a spike strip.", RPN(playerid));
SendCopMessage(COLOR_BLUE, string);
ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,0,0,0,0,0); // Plant bomb
return 1;
}
pawn Код:
|