help with my /stealth command
#1

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.
Reply
#2

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??
Reply
#3

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

Код:
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
Reply
#5

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.
Reply
#6

Make a loop.
I recommend using foreach.
Reply
#7

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

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.
Reply
#9

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 );
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)