SA-MP Forums Archive
Need help with 'UAV' Script - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need help with 'UAV' Script (/showthread.php?tid=148313)



Need help with 'UAV' Script - DaneAMattie - 16.05.2010

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 :/


Re: Need help with 'UAV' Script - DaneAMattie - 16.05.2010

ugh anyone?


Re: Need help with 'UAV' Script - DaneAMattie - 17.05.2010

Come on, why is everyone ignoring this? XD


Re: Need help with 'UAV' Script - DJDhan - 17.05.2010

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


Re: Need help with 'UAV' Script - ViruZZzZ_ChiLLL - 17.05.2010

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


Re: Need help with 'UAV' Script - DaneAMattie - 17.05.2010

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 :/


Re: Need help with 'UAV' Script - DJDhan - 17.05.2010

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;



Re: Need help with 'UAV' Script - CracK - 17.05.2010

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.


Re: Need help with 'UAV' Script - DaneAMattie - 17.05.2010

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


Re: Need help with 'UAV' Script - DJDhan - 17.05.2010

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);
	}
       }
   }