SA-MP Forums Archive
help with my /stealth command - 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: help with my /stealth command (/showthread.php?tid=186650)



help with my /stealth command - Haydz - 30.10.2010

I'v been trying to make a /stealth command if a player has a kill streak of 3
My problem is the stealth part, SetPlayerMarkerForPlayer( 100, 1, 0xFFFFFF00 ); hides the players icon, but when i i'm not sure on what would make there icon appear again when they type /stealthoff
my code so far:

Код:
    if (strcmp("/stealth", cmdtext, true, 5) == 0)
    {
   	if(KillingSpree[playerid] < 3) return SendClientMessage(playerid,COLOR_YELLOW,"You Need A Kill Streak of 3 To Use Stealth Mode");
   	KillingSpree[playerid]-3;
   	if(GetPVarInt(playerid,"CMDABUSE")>GetTickCount())return SendClientMessage(playerid,0xFF0000FF,"You Can Only Use This Command every 30 seconds.");
	SetPVarInt(playerid,"CMDABUSE",GetTickCount()+30000);
	SetPlayerMarkerForPlayer( 100, 1, 0xFFFFFF00 );
	SendClientMessage(playerid, COLOR_RED,"Type /stealthoff To Disabled Stealth Mode");
	return 1;
	}
if (strcmp("/stealthoff", cmdtext, true, 5) == 0)
    {
   	if(KillingSpree[playerid] < 3) return SendClientMessage(playerid,COLOR_RED,"You Havn't Activated Stealth Mode Yet!");
   	KillingSpree[playerid]-3;
   	if(GetPVarInt(playerid,"CMDABUSE")>GetTickCount())return SendClientMessage(playerid,0xFF0000FF,"You Can Only Use This Command every 30 seconds.");
	SetPVarInt(playerid,"CMDABUSE",GetTickCount()+30000);
	SetPlayerMarkerForPlayer( 100, 1, COLOR_ORANGE );
	SendClientMessage(playerid, COLOR_RED,"Stealth Mode Disabled");
	return 1;
	}
any help would be appreciated.


Re: help with my /stealth command - <Weponz> - 30.10.2010

Quote:
Originally Posted by Hayden_Bruin
Посмотреть сообщение
I'v been trying to make a /stealth command if a player has a kill streak of 3
My problem is the stealth part, SetPlayerMarkerForPlayer( 100, 1, 0xFFFFFF00 ); hides the players icon, but when i i'm not sure on what would make there icon appear again when they type /stealthoff
my code so far:

Код:
    if (strcmp("/stealth", cmdtext, true, 5) == 0)
    {
   	if(KillingSpree[playerid] < 3) return SendClientMessage(playerid,COLOR_YELLOW,"You Need A Kill Streak of 3 To Use Stealth Mode");
   	KillingSpree[playerid]-3;
   	if(GetPVarInt(playerid,"CMDABUSE")>GetTickCount())return SendClientMessage(playerid,0xFF0000FF,"You Can Only Use This Command every 30 seconds.");
	SetPVarInt(playerid,"CMDABUSE",GetTickCount()+30000);
	SetPlayerMarkerForPlayer( 100, 1, 0xFFFFFF00 );
	SendClientMessage(playerid, COLOR_RED,"Type /stealthoff To Disabled Stealth Mode");
	return 1;
	}
if (strcmp("/stealthoff", cmdtext, true, 5) == 0)
    {
   	if(KillingSpree[playerid] < 3) return SendClientMessage(playerid,COLOR_RED,"You Havn't Activated Stealth Mode Yet!");
   	KillingSpree[playerid]-3;
   	if(GetPVarInt(playerid,"CMDABUSE")>GetTickCount())return SendClientMessage(playerid,0xFF0000FF,"You Can Only Use This Command every 30 seconds.");
	SetPVarInt(playerid,"CMDABUSE",GetTickCount()+30000);
	SetPlayerMarkerForPlayer( 100, 1, COLOR_ORANGE );
	SendClientMessage(playerid, COLOR_RED,"Stealth Mode Disabled");
	return 1;
	}
any help would be appreciated.
WOW nice code..When its fixed may i use it on my server??


Re: help with my /stealth command - Haydz - 30.10.2010

Quote:
Originally Posted by <Weponz>
Посмотреть сообщение
WOW nice code..When its fixed may i use it on my server??
Sure thing, thanks for asking.


Re: help with my /stealth command - TouR - 30.10.2010

Код:
if (strcmp("/stealthoff", cmdtext, true, 5) == 0)
    {
   	if(KillingSpree[playerid] < 3) return SendClientMessage(playerid,COLOR_RED,"You Havn't Activated Stealth Mode Yet!");
   	KillingSpree[playerid]-3;
   	if(GetPVarInt(playerid,"CMDABUSE")>GetTickCount())return SendClientMessage(playerid,0xFF0000FF,"You Can Only Use This Command every 30 seconds.");
	SetPVarInt(playerid,"CMDABUSE",GetTickCount()+30000);
	SetPlayerMarkerForPlayer( 100, 1, COLOR_ORANGE );
	SendClientMessage(playerid, 0xRRGGBBFF,"Stealth Mode Disabled");
	return 1;
	}
Try this i changed 00 to FF at the color


Re: help with my /stealth command - Haydz - 30.10.2010

Quote:
Originally Posted by tour15
Посмотреть сообщение
Код:
if (strcmp("/stealthoff", cmdtext, true, 5) == 0)
    {
   	if(KillingSpree[playerid] < 3) return SendClientMessage(playerid,COLOR_RED,"You Havn't Activated Stealth Mode Yet!");
   	KillingSpree[playerid]-3;
   	if(GetPVarInt(playerid,"CMDABUSE")>GetTickCount())return SendClientMessage(playerid,0xFF0000FF,"You Can Only Use This Command every 30 seconds.");
	SetPVarInt(playerid,"CMDABUSE",GetTickCount()+30000);
	SetPlayerMarkerForPlayer( 100, 1, COLOR_ORANGE );
	SendClientMessage(playerid, 0xRRGGBBFF,"Stealth Mode Disabled");
	return 1;
	}
Try this i changed 00 to FF at the color
Thats the wrong line, i need
Код:
SetPlayerMarkerForPlayer( 100, 1, COLOR_ORANGE );
to reset so you can see the players marker again. "100" is the id of the player it's seeable for, i need to make it so that it's for every id.


Re: help with my /stealth command - Retardedwolf - 30.10.2010

Make a loop.
I recommend using foreach.


Re: help with my /stealth command - <Weponz> - 30.10.2010

Quote:
Originally Posted by Hayden_Bruin
Посмотреть сообщение
Sure thing, thanks for asking.
Thanks Again you will be credited for the code


Re: help with my /stealth command - Haydz - 30.10.2010

Quote:
Originally Posted by Retardedwolf
Посмотреть сообщение
Make a loop.
I recommend using foreach.
After i installed the plugin what would i do then, could you explain it please.


Re: help with my /stealth command - Retardedwolf - 30.10.2010

foreach isn't a plugin. Its a include.

Add
Код:
#include <foreach
on top of your script. Then use
pawn Код:
foreach(Player, i)
pawn Код:
SetPlayerMarkerForPlayer( i, playerid, COLOR_ORANGE );