Need help with 'UAV' Script
#1

So i put this on OnPlayerSpawn:

Код:
if(UAVSTATUS == true){
  switch(gTeam[playerid]){
   case TEAM_ARMY:{
     for(new i;i<MAX_PLAYERS;i++)
      SetPlayerMarkerForPlayer(i, playerid, TEAM_COLOR_ARMY);
   }
   case TEAM_MAFFIA:{
     for(new i;i<MAX_PLAYERS;i++)
      SetPlayerMarkerForPlayer(i, playerid, TEAM_COLOR_MAFFIA);
   }
  }
  } else {
   for(new i;i<MAX_PLAYERS;i++)
     SetPlayerMarkerForPlayer(i, playerid, invisible);
  }
on GameModeInit
UAVSTATUS = false
and if someone buys a UAV it will be true
But the players are still visible :/
Reply
#2

ugh anyone?
Reply
#3

Come on, why is everyone ignoring this? XD
Reply
#4

What is UAV? Is it like buying it will show the player markers for the player?
Reply
#5

Yes, first, kindly explain what is UAV, so we can help
you with this Unmanned Aerial Vehicle?
Reply
#6

Quote:
Originally Posted by DJDhan
What is UAV? Is it like buying it will show the player markers for the player?
Yes

so

UAV reveals ennemy markers on the map
and i made a lil script above (with some help of someone else) but its still not working :/
Reply
#7

Quote:
Originally Posted by DaneAMattie
Yes
so
UAV reveals ennemy markers on the map
and i made a lil script above (with some help of someone else) but its still not working :/
Right, like treason.
On top of script:
Код:
new bool: UAVSTATUS[MAX_PLAYERS];
Under OnGamemodeInit():
Код:
ShowPlayerMarkers(0);
Then when he buys UAV
Код:
UAVSTATUS[playerid]=true;
  
switch(gTeam[playerid])
  {
   case TEAM_ARMY:
	{
       for(new i=0;i<=GetMaxPlayer();i++)
       SetPlayerMarkerForPlayer(playerid, i, TEAM_COLOR_MAFFIA);
       }
   case TEAM_MAFFIA:
       {
       for(new i=0;i<=GetMaxPlayers();i++)
       SetPlayerMarkerForPlayer(playerid, i, TEAM_COLOR_ARMY);
       }
   }
Then OnPlayerDisConnect() or OnPlayerDeath() [wherever you want to end the UAV]
Код:
UAVSTATUS[playerid]=false;
Reply
#8

You must show/hide markers every time in OnPlayerStreamIn(playerid, forplayerid) also.
Otherwise, when a player go out of streaming distance the marker will be reset.
Reply
#9

Quote:
Originally Posted by DJDhan
Quote:
Originally Posted by DaneAMattie
Yes
so
UAV reveals ennemy markers on the map
and i made a lil script above (with some help of someone else) but its still not working :/
Right, like treason.
On top of script:
Код:
new bool: UAVSTATUS[MAX_PLAYERS];
Under OnGamemodeInit():
Код:
ShowPlayerMarkers(0);
Then when he buys UAV
Код:
UAVSTATUS[playerid]=true;
  
switch(gTeam[playerid])
  {
   case TEAM_ARMY:
	{
       for(new i=0;i<=GetMaxPlayer();i++)
       SetPlayerMarkerForPlayer(playerid, i, TEAM_COLOR_MAFFIA);
       }
   case TEAM_MAFFIA:
       {
       for(new i=0;i<=GetMaxPlayers();i++)
       SetPlayerMarkerForPlayer(playerid, i, TEAM_COLOR_ARMY);
       }
   }
Then OnPlayerDisConnect() or OnPlayerDeath() [wherever you want to end the UAV]
Код:
UAVSTATUS[playerid]=false;
right but i mean, the whole team of the one who bought a UAV must see the UAV :P
and at the start all ennemy players must be invisible
Reply
#10

Replace
Код:
switch(gTeam[playerid])
  {
   case TEAM_ARMY:
	{
       for(new i=0;i<=GetMaxPlayer();i++)
       SetPlayerMarkerForPlayer(playerid, i, TEAM_COLOR_MAFFIA);
       }
   case TEAM_MAFFIA:
       {
       for(new i=0;i<=GetMaxPlayers();i++)
       SetPlayerMarkerForPlayer(playerid, i, TEAM_COLOR_ARMY);
       }
   }
With this:
Код:
switch(gTeam[playerid])
  {
   case TEAM_ARMY:
	{
       for(new i=0;i<=GetMaxPlayer();i++)
	if(gTeam[i]==TEAM_MAFFIA)
	{
       SetPlayerMarkerForPlayer(playerid, i, TEAM_COLOR_MAFFIA);
	}
       }
   case TEAM_MAFFIA:
       {
       for(new i=0;i<=GetMaxPlayers();i++)
	if(gTeam[i]==TEAM_MAFFIA)
	{
       SetPlayerMarkerForPlayer(playerid, i, TEAM_COLOR_ARMY);
	}
       }
   }
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)