SA-MP Forums Archive
Checking the value of somebody elses value. - 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)
+--- Thread: Checking the value of somebody elses value. (/showthread.php?tid=329241)



Checking the value of somebody elses variable. - NewerthRoleplay - 27.03.2012

Hi i wonder if anybody knows how i can check somebody elses value for a variable. For example i've saved somebody's position to a variable on their side but i would like it so that somebody else can check their variable and use it. For example somebody requests a taxi, his position is then saved to a variable and then the taxi driver gets a checkpoint set at where the persons position who asked for one using that variable.

How would i go about doing this, i have already made it so that the taxi driver is notified when somebody requests a taxi.

Thanks -Connor


Re: Checking the value of somebody elses value. - NewerthRoleplay - 27.03.2012

bump


Re: Checking the value of somebody elses value. - [ABK]Antonio - 27.03.2012

pawn Код:
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]); //The one who requested the taxi
//Create a checkpoint or something here... (use Pos[0] as X, Pos[1] as Y, Pos[2] as Z for the checkpoint pos)



Re: Checking the value of somebody elses value. - new121 - 27.03.2012

PHP код:
CMD:servicetaxi(playerid, params[])
{
      new 
name[24], Float:X, Float:Y, Float: Z, string[128];
      
GetPlayerPos(playerid, X, Y, Z);
      
GetPlayerName(playerid,name,sizeof(name));
      for(new 
i=0; i<MAX_PLAYERS; i++)
      {
             if(
PlayerInfo[i][pJob] == Taxi Driver)// you will prolly have to edit this to fit your needs
             
{
                     
format(string,sizeof(string),"%s has requested a taxi, his position has been added to your GPS", name);
                     
SetPlayerCheckpoint(i, X, Y, Z);
                     
SendClientMessage(i, -1,  string);
             }
       }
        return 
1;
} 



Re: Checking the value of somebody elses value. - NewerthRoleplay - 22.04.2012

Quote:
Originally Posted by new121
Посмотреть сообщение
PHP код:
CMD:servicetaxi(playerid, params[])
{
      new 
name[24], Float:X, Float:Y, Float: Z, string[128];
      
GetPlayerPos(playerid, X, Y, Z);
      
GetPlayerName(playerid,name,sizeof(name));
      for(new 
i=0; i<MAX_PLAYERS; i++)
      {
             if(
PlayerInfo[i][pJob] == Taxi Driver)// you will prolly have to edit this to fit your needs
             
{
                     
format(string,sizeof(string),"%s has requested a taxi, his position has been added to your GPS", name);
                     
SetPlayerCheckpoint(i, X, Y, Z);
                     
SendClientMessage(i, -1,  string);
             }
       }
        return 
1;
} 
Thank you so much! +rep <3