Jump to content

Tutorial sistem somatie


Dr.House

Recommended Posts

  • 2 weeks later...

Poftim, sper sa iti fie de ajutor !

#include <zmcd>
#define GPP GetPlayerPos

// Ai nevoie de publicul ProxDetector ..

stock GUName(playerid)
{
	new s[MAX_PLAYER_NAME+1];
	GetPlayerName(playerid, s, sizeof(s));
	return s;
}

CMD:som(playerid, params[]) 
{
	new str[255], cmdL[32], getID, Float:ppos[3];
	if(sscanf(params, "s[32]u", cmdL, getID)) return SCM(playrid, -1, "USAGE: /som [type (Wanted, Contrasens, ETC)] [PartOfName/ID]");
	GPP(playerid, ppos[0], ppos[1], ppos[2]);
	
	if(!strcmp(cmdL, "wanted", false))
	{
		if(IsPlayerInRangeOfPoint(getID, 10.0, ppos[0], ppos[1], ppos[2])) // Verifica daca politistul este in raza suspectului si trimite mesajul !
		{
			if(PlayerData[pFaction] == 1 && PlayerData[pMember] == 1 && InPlayerIn)
			{
				format(str, sizeof(str), "[Rank] %s: %s esti suspect cu wanted, te predai?", GUName(playerid), GUName(getID));
				ProxDetector(10.0, playerid, str, -1, -1, -1, -1, -1);
			}
			else if(PlayerData[pFaction] == 2 && PlayerData[pMember] == 2)
			{
				format(str, sizeof(str), "[Rank] %s: %s esti suspect cu wanted, te predai?", GUName(playerid), GUName(getID));
				ProxDetector(10.0, playerid, str, -1, -1, -1, -1, -1);
			} else if(PlayerData[pFaction] == 2 && PlayerData[pMember] == 3)
			{
				format(str, sizeof(str), "[Rank] %s: %s esti suspect cu wanted, te predai?", GUName(playerid), GUName(getID));
				ProxDetector(10.0, playerid, str, -1, -1, -1, -1, -1);
			}
		} else SCM(playerid, -1, "Suspectul este prea departe de tine !");
	}
	
	if(!strcmp(cmdL, "contrasens", false))
	{
		if(IsPlayerInRangeOfPoint(getID, 10.0, ppos[0], ppos[1], ppos[2])) // Verifica daca politistul este in raza suspectului si trimite mesajul !
		{
			if(PlayerData[pFaction] == 1 && PlayerData[pMember] == 1 && InPlayerIn)
			{
				format(str, sizeof(str), "[Rank] %s: %s esti urmarit, trage pe dreapta !", GUName(playerid), GUName(getID));
				ProxDetector(10.0, playerid, str, -1, -1, -1, -1, -1);
			}
			else if(PlayerData[pFaction] == 2 && PlayerData[pMember] == 2)
			{
				format(str, sizeof(str), "[Rank] %s: %s esti urmarit, trage pe dreapta !", GUName(playerid), GUName(getID));
				ProxDetector(10.0, playerid, str, -1, -1, -1, -1, -1);
			} else if(PlayerData[pFaction] == 2 && PlayerData[pMember] == 3)
			{
				format(str, sizeof(str), "[Rank] %s: %s esti urmarit, trage pe dreapta !", GUName(playerid), GUName(getID));
				ProxDetector(10.0, playerid, str, -1, -1, -1, -1, -1);
			}
		} else SCM(playerid, -1, "Suspectul este prea departe de tine !");
	}
	return 1;
}

 

Edited by [PAWN]Stark.7
  • Upvote 1
Link to comment
Share on other sites

On 3/10/2016 at 13:28, [PAWN]Stark.7 said:

Poftim, sper sa iti fie de ajutor !


#include <zmcd>
#define GPP GetPlayerPos

// Ai nevoie de publicul ProxDetector ..

stock GUName(playerid)
{
	new s[MAX_PLAYER_NAME+1];
	GetPlayerName(playerid, s, sizeof(s));
	return s;
}

CMD:som(playerid, params[]) 
{
	new str[255], cmdL[32], getID, Float:ppos[3];
	if(sscanf(params, "s[32]u", cmdL, getID)) return SCM(playrid, -1, "USAGE: /som [type (Wanted, Contrasens, ETC)] [PartOfName/ID]");
	GPP(playerid, ppos[0], ppos[1], ppos[2]);
	
	if(!strcmp(cmdL, "wanted", false))
	{
		if(IsPlayerInRangeOfPoint(getID, 10.0, ppos[0], ppos[1], ppos[2])) // Verifica daca politistul este in raza suspectului si trimite mesajul !
		{
			if(PlayerData[pFaction] == 1 && PlayerData[pMember] == 1 && InPlayerIn)
			{
				format(str, sizeof(str), "[Rank] %s: %s esti suspect cu wanted, te predai?", GUName(playerid), GUName(getID));
				ProxDetector(10.0, playerid, str, -1, -1, -1, -1, -1);
			}
			else if(PlayerData[pFaction] == 2 && PlayerData[pMember] == 2)
			{
				format(str, sizeof(str), "[Rank] %s: %s esti suspect cu wanted, te predai?", GUName(playerid), GUName(getID));
				ProxDetector(10.0, playerid, str, -1, -1, -1, -1, -1);
			} else if(PlayerData[pFaction] == 2 && PlayerData[pMember] == 3)
			{
				format(str, sizeof(str), "[Rank] %s: %s esti suspect cu wanted, te predai?", GUName(playerid), GUName(getID));
				ProxDetector(10.0, playerid, str, -1, -1, -1, -1, -1);
			}
		} else SCM(playerid, -1, "Suspectul este prea departe de tine !");
	}
	
	if(!strcmp(cmdL, "contrasens", false))
	{
		if(IsPlayerInRangeOfPoint(getID, 10.0, ppos[0], ppos[1], ppos[2])) // Verifica daca politistul este in raza suspectului si trimite mesajul !
		{
			if(PlayerData[pFaction] == 1 && PlayerData[pMember] == 1 && InPlayerIn)
			{
				format(str, sizeof(str), "[Rank] %s: %s esti urmarit, trage pe dreapta !", GUName(playerid), GUName(getID));
				ProxDetector(10.0, playerid, str, -1, -1, -1, -1, -1);
			}
			else if(PlayerData[pFaction] == 2 && PlayerData[pMember] == 2)
			{
				format(str, sizeof(str), "[Rank] %s: %s esti urmarit, trage pe dreapta !", GUName(playerid), GUName(getID));
				ProxDetector(10.0, playerid, str, -1, -1, -1, -1, -1);
			} else if(PlayerData[pFaction] == 2 && PlayerData[pMember] == 3)
			{
				format(str, sizeof(str), "[Rank] %s: %s esti urmarit, trage pe dreapta !", GUName(playerid), GUName(getID));
				ProxDetector(10.0, playerid, str, -1, -1, -1, -1, -1);
			}
		} else SCM(playerid, -1, "Suspectul este prea departe de tine !");
	}
	return 1;
}

 

Mersi mult

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.