Martin_Voitel
Умник
PHP:
if(strcmp(cmd, "/stinger", true) == 0)
{
if(!(PlayerInfo[playerid][pMember]==6||PlayerInfo[playerid][pLeader]==6))
if(!(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1))
{
SendClientMessage(playerid, COLOR_GRAD1, "Вы не коп");
return 1;
}
if(totalstinger==(MAX_STINGERS-1))
{
SendClientMessage(playerid, COLOR_GRAD1, "Шипы закончились");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_GRAD1, "Выйдите из машины");
return 1;
}
/*if(PlayerInfo[playerid][pTeam]==1&&PlayerInfo[playerid][pRank]<6)
{
SendClientMessage(playerid, COLOR_GRAD1, "Шипы с 6 ранга");
return 1;
}
if(PlayerInfo[playerid][pTeam]==13&&PlayerInfo[playerid][pRank]<3)
{
SendClientMessage(playerid, COLOR_GRAD1, "Шипы с 3 ранга");
return 1;
}*/
totalstinger=totalstinger+1;
new Float:xA,Float:yA,Float:zA,Float:rot;
GetPlayerPos(playerid,xA,yA,zA);
GetPlayerFacingAngle(playerid,rot);
GetPlayerName(playerid,sendername,sizeof(sendername));
stinger[totalstinger]= CreateObject(2899,xA,yA,(zA-0.87),0.0,0.0,rot,300.0);
format(string, sizeof(string), "* %s поставил шипы",sendername);
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
if(MAX_STINGERS-totalstinger>0){
format(string,sizeof(string), "осталось %d шипов.", (MAX_STINGERS-1-totalstinger));
}
else
{
format(string,sizeof(string), "осталось 0 шипов.");
}
SendClientMessage(playerid,COLOR_WHITE,string);
return 1;
}
PHP:
if(strcmp(cmd, "/delstinger", true) == 0)
{
if(!(PlayerInfo[playerid][pMember]==6||PlayerInfo[playerid][pLeader]==6))
if(!(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1))
{
SendClientMessage(playerid, COLOR_GRAD1, "Вы не коп!");
return 1;
}
new Float:xA,Float:yA,Float:zA;
for(new id=0; id<MAX_STINGERS; id++)
{
if(IsValidObject(stinger[id]))
{
GetObjectPos(stinger[id],xA,yA,zA);
if(IsPlayerInRangeOfPoint(playerid,1.2,xA,yA,zA))
{
GetPlayerName(playerid,sendername,sizeof(sendername));
DestroyObject(stinger[id]);
totalstinger-=1;
format(string, sizeof(string), "* %s убрал шипы",sendername);
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
format(string,sizeof(string), "осталось %d шипов", (MAX_STINGERS-1-totalstinger));
SendClientMessage(playerid,COLOR_WHITE,string);
return 1;
}
}
}
SendClientMessage(playerid, COLOR_GRAD1, "Вы не возле шипов");
return 1;
}
---------- Post added at 14:09 ---------- Previous post was at 13:42 ----------
Обновил.
Последнее редактирование:
