Minigun question?
#1

Hi Guys,

I use this code for TEAM SURVIVORS

PHP код:
dcmd_minigun(playerid,params[])
{
  
#pragma unused params
  
if(gTeam[playerid] != TEAM_SURVIVANT || AdminLevel[playerid] != 1)
  {
      
SendClientMessage(playerid,0x8C6346FF,"Vous ne pouvez pas utiliser cette commande en йtant qu'un Zombie.");
      return 
1;
  }
  if(
gTeam[playerid] == TEAM_SURVIVANT || AdminLevel[playerid] == 1)
  {
  new 
Float:createxFloat:createyFloat:createzFloat:Rotation;
  
GetPlayerPos(playerid,createx,createy,createz);
  
GetPlayerFacingAngle(playerid,Rotation);
  
SaveMinigunDataToLog(CreateMinigun(createx,createy,createz -1,Rotation,10,4,true),"blub");
  
MinigunPlaced[playerid] =1;
  
SetTimer("DetruireMinigun",180000,1);
  }
  return 
1;
}
PUBLIC:
DetruireMinigun(playerid)
{
    new 
minigunid;
    
DestroyMinigun(minigunid);
    
MinigunPlaced[playerid] =0;

So they can create their miniguns to attack everyone,

But, i have a question ?

How to make this minigun attacks only the zombies and not the survivors ?

Sorry for my bad english i am french

Thanks.
Reply
#2

Maybe it attacks cuz it works for admins aswell, so even if you are survival, it will attack you , as you are adm.


Also you can try to use this format

pawn Код:
if(gTeam[playerid] == TEAM_SURVIVANT || AdminLevel[playerid] == 1)
  {
//Your attack code
  }
else
{
      SendClientMessage(playerid,0x8C6346FF,"Vous ne pouvez pas utiliser cette commande en йtant qu'un Zombie.");
}
Reply
#3

PHP код:
dcmd_minigun(playerid,params[])
{
  
#pragma unused params
  
if(gTeam[playerid] == TEAM_SURVIVANT || AdminLevel[playerid] == 1)
  {
  new 
Float:createxFloat:createyFloat:createzFloat:Rotation;
  
GetPlayerPos(playerid,createx,createy,createz);
  
GetPlayerFacingAngle(playerid,Rotation);
  
SaveMinigunDataToLog(CreateMinigun(createx,createy,createz -1,Rotation,10,4,true),"blub");
  
MinigunPlaced[playerid] =1;
  
SetTimer("DetruireMinigun",180000,1);
  }
  else(
gTeam[playerid] != TEAM_SURVIVANT || AdminLevel[playerid] != 1)
  {
      
SendClientMessage(playerid,0x8C6346FF,"Vous ne pouvez pas utiliser cette commande en йtant qu'un Zombie.");
      return 
1;
  }
  return 
1;

Like this ?
Reply
#4

exactly, also you dont need that return 1; under SendClientMessage.

and use just

else
{

}


NOT

else(gTeam[playerid] != TEAM_SURVIVANT || AdminLevel[playerid] != 1)
{

}
Reply
#5

PHP код:
dcmd_minigun(playerid,params[])
{
  
#pragma unused params
  
if(gTeam[playerid] == TEAM_SURVIVANT || AdminLevel[playerid] == 1)
  {
  new 
Float:createxFloat:createyFloat:createzFloat:Rotation;
  
GetPlayerPos(playerid,createx,createy,createz);
  
GetPlayerFacingAngle(playerid,Rotation);
  
SaveMinigunDataToLog(CreateMinigun(createx,createy,createz -1,Rotation,10,4,true),"blub");
  
MinigunPlaced[playerid] =1;
  
SetTimer("DetruireMinigun",180000,1);
  }
  else
  {
      
SendClientMessage(playerid,0x8C6346FF,"Vous ne pouvez pas utiliser cette commande en йtant qu'un Zombie.");
  return 
1;

It keeps attacking me..
Reply
#6

If you DONT want that they attack to survivals, then change TEAM_SURVIVANT to TEAM_ZOMBIE, or you want that survivals can use this cmd to attack zombies ?
If so, you need to check attack code itself
Reply
#7

Quote:
Originally Posted by ikey07
Посмотреть сообщение
you want that survivals can use this cmd to attack zombies ?
That what i wan't,

The problem is, it's an include of miniguns..

So i can't figure it out
Reply
#8

Help..?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)