SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 12/01/2010, 02:19 PM   #1
Oi!
Big Clucker
 
Join Date: May 2009
Posts: 104
Reputation: 0
Default [Help] /find

Okay for some reason every time I find some-one the marker doesn't go away, I see why but I don't get how it would work or how I can fix it, so maybe you guys can help me do that.

Something to do with: SetPlayerMarkerForPlayer(playerid,giveplayerid,0xF F6347AA); I guess.

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(PlayerInfo[playerid][pFindTimer] > 0)
			{
 				format(string, sizeof(string), "You have %d more seconds before you can find someone again!", PlayerInfo[playerid][pFindTimer]);
				SendClientMessage(playerid, COLOR_GREY, string);
			  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)
					{
						PlayerInfo[playerid][pFindTimer] = 120;
						points = 4;
					}
					else if(level >= 51 && level <= 100)
					{
						PlayerInfo[playerid][pFindTimer] = 90;
						points = 6;
					}
					else if(level >= 101 && level <= 200)
					{
						PlayerInfo[playerid][pFindTimer] = 60;
						points = 8;
					}
					else if(level >= 201 && level <= 400)
					{
						PlayerInfo[playerid][pFindTimer] = 30;
						points = 10;
					}
					else if(level >= 401)
					{
						PlayerInfo[playerid][pFindTimer] = 15;
						points = 12;
					}
					GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					SetPlayerMarkerForPlayer(playerid,giveplayerid,0xFF6347AA);
					FindTime[playerid] = 1;
					FindTimePoints[playerid] = points;
					PlayerInfo[playerid][pDetSkill] ++;
					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;
	}
Code:
			if(FindTime[i] > 0)
			{
				if(FindTime[i] == FindTimePoints[i])
				{
					FindTime[i] = 0;
					FindTimePoints[i] = 0;
					PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
					GameTextForPlayer(i, "~r~RedMarker gone", 2500, 1);
					SetPlayerToTeamColor(i);
				}
	  			else
  			{
			  	format(string, sizeof(string), "%d", FindTimePoints[i] - FindTime[i]);
					GameTextForPlayer(i, string, 1500, 6);
					FindTime[i] += 1;
				}
			}
Oi! is offline  
Old 12/01/2010, 05:58 PM   #2
Oi!
Big Clucker
 
Join Date: May 2009
Posts: 104
Reputation: 0
Default Re: [Help] /find

bump
Oi! 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 4 19/12/2009 12:07 AM
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 09:30 AM.


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