Вставить в OnPlayerCommandText
- Код:
if(strcmp(cmd, "/fire", true) == 0)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
new fireon = random(2);
if(fireon1 == 1)
{
SendClientMessage(playerid,COLOR_GREY,"Огонь уже горит!");
return 1;
}
if(fireon == 1)
{
fireon1 = 1;
new names[MAX_PLAYER_NAME];
ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.1,0,1,1,1,1);
SetPlayerFacingAngle(playerid, 270.4084);
pause(2);
GetPlayerName(playerid, names, sizeof(names));
format(string, sizeof(string), "%s зажег костер",names);
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
firef = CreateObject(18688,X+0.5,Y,Z-2.5,0.00000000,0.00000000,0.00000000);
ClearAnimations(playerid);
}
if(fireon != 1)
{
new names[MAX_PLAYER_NAME];
GetPlayerName(playerid, names, sizeof(names));
ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.1,0,1,1,1,1);
SetPlayerFacingAngle(playerid, 270.4084);
pause(2);
ClearAnimations(playerid);
format(string, sizeof(string), "%s не получилось зажечь костёр",names);
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
if(strcmp(cmd, "/fireoff", true) == 0)
{
new names[MAX_PLAYER_NAME];
GetPlayerName(playerid, names, sizeof(names));
pause(2);
ClearAnimations(playerid);
DestroyObject(firef);
format(string, sizeof(string), "%s потушил костёр",names);
fireon1 = 0;
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}