SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 16/12/2009, 03:42 AM   #1
Oi!
Big Clucker
 
Join Date: May 2009
Posts: 104
Reputation: 0
Default [help] /find

Okay guys so basically what I'm making is a /find command so that if the player is a passenger then the driver and other passengers can see the red marker. I just need a little bit of help doing so. Here's what I have.

Code:
  if(strcmp(cmd, "/find", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
		  if(PlayerInfo[playerid][pJob] != 1)
		  {
				SendClientMessage(playerid, COLOR_GREY, "  You are not a mercenary !");
				return 1;
		  }
			if(UsedFind[playerid] != 0 && PlayerInfo[playerid][pDetSkill] < 401)
			{
			  SendClientMessage(playerid, COLOR_GREY, "  You've already searched for someone, please wait for your time to reload!");
			  return 1;
			}
		  tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /find [playerid/PartOfName]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if(IsPlayerConnected(giveplayerid))
			{
			  if(giveplayerid != INVALID_PLAYER_ID)
			  {
			    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Find yourself!"); return 1; }
			    new points;
			    new level = PlayerInfo[playerid][pDetSkill];
					if(level >= 0 && level <= 50)
					{
						points = 4;
					}
					else if(level >= 51 && level <= 100)
					{
						points = 6;
					}
					else if(level >= 101 && level <= 200)
					{
						points = 8;
					}
					else if(level >= 201 && level <= 400)
					{
						points = 10;
					}
					else if(level >= 401)
					{
						points = 12;
					}
					GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					GetPlayerColor(giveplayerid);
  				SetPlayerMarkerForPlayer(playerid,giveplayerid,0xFF6347AA);
					FindTime[playerid] = 1;
					FindTimePoints[playerid] = points;
					PlayerInfo[playerid][pDetSkill] ++;
					UsedFind[playerid] = 1;
					if(PlayerInfo[playerid][pDetSkill] == 50)
					{ SendClientMessage(playerid, COLOR_YELLOW, "* Your Mercenary Skill is now Level 2, you now have more time to find people."); }
					else if(PlayerInfo[playerid][pDetSkill] == 100)
					{ SendClientMessage(playerid, COLOR_YELLOW, "* Your Mercenary Skill is now Level 3, you now have more time to find people."); }
					else if(PlayerInfo[playerid][pDetSkill] == 200)
					{ SendClientMessage(playerid, COLOR_YELLOW, "* Your Mercenary Skill is now Level 4, you now have more time to find people."); }
					else if(PlayerInfo[playerid][pDetSkill] == 400)
					{ SendClientMessage(playerid, COLOR_YELLOW, "* Your Mercenary Skill is now Level 5, you now have more time to find people."); }
				}
			}
			else
			{
			  SendClientMessage(playerid, COLOR_GREY, "  Invalid Name/ID !");
			}
		}
	  return 1;
	}
Oi! is offline  
Old 16/12/2009, 09:36 AM   #2
Retardedwolf
High-roller
 
Retardedwolf's Avatar
 
Join Date: Jun 2009
Posts: 1,468
Reputation: 60
Default Re: [help] /find

Use a loop get the players in the vehicle.
SetMarkerForPlayer(i,0xFF6347AA);
Retardedwolf is offline  
Old 16/12/2009, 10:23 AM   #3
RyDeR`
High-roller
 
RyDeR`'s Avatar
 
Join Date: Feb 2009
Location: Belgium
Posts: 2,929
Reputation: 700
Default Re: [help] /find

Like he said;

Code:
for(new i; i<MAX_PLAYERS; i++)
   if(IsPlayerInVehicle(i)) SetMarkerForPlayer(i, 0xFF6347AA);
__________________

Sup?
RyDeR` is offline  
Old 18/12/2009, 05:51 PM   #4
Oi!
Big Clucker
 
Join Date: May 2009
Posts: 104
Reputation: 0
Default Re: [help] /find

Quote:
Originally Posted by RR
Like he said;

Code:
for(new i; i<MAX_PLAYERS; i++)
  if(IsPlayerInVehicle(i)) SetMarkerForPlayer(i, 0xFF6347AA);
When I put that in it gives me any error saying that "SetMarkerForPlayer" is an invaild name or something like that. Are you sure it isn't "SetPlayerMarkerForPlayer"?
Oi! is offline  
Old 19/12/2009, 12:07 AM   #5
Retardedwolf
High-roller
 
Retardedwolf's Avatar
 
Join Date: Jun 2009
Posts: 1,468
Reputation: 60
Default Re: [help] /find

Use this http://forum.sa-mp.com/index.php?topic=69459.0

And change SetMarkerForPlayer to CreateCheckpoint(i, Float:cpX, Float:cpY, Float:cpZ, Float:cpS, Float:viewdiss);
Retardedwolf is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Help] /find Oi! Help Archive 1 12/01/2010 05:58 PM
trying to find a map propilot Help Archive 5 12/12/2009 12:34 PM
Were can i find this GM addysnow1 Help Archive 0 15/11/2009 09:27 PM
Where can i find LA-RP??!?!?! arsham Help Archive 1 21/07/2009 02:50 PM
Where can I find the ip of my sv? belive Server Support 1 24/03/2009 12:12 PM


All times are GMT. The time now is 03:05 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.