MapIcon help. - 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: MapIcon help. (
/showthread.php?tid=156945)
MapIcon help. -
Doppeyy - 24.06.2010
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (newkeys & KEY_FIRE)
{
for(new q = 0; q > 50; q++)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
if(IsPlayerConnected(q)) SetPlayerMapIcon(q, 1, x, y, z, 41, COLOR_RED);
SetTimer("ShootIcon",2000,0);
}
}
return 1;
}
I have this code from a friend and he wants to make when someone press the mouse button you get a mapicon over there.
But it doesnt work and i have no idea what to do to fix it :S. Does anyone of you know how to make it show for all players ?
~Nookie
Re: MapIcon help. -
ReVo_ - 24.06.2010
Not tested :S
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (newkeys & KEY_FIRE)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetPlayerMarkerForPlayer(playerid, i, GetPlayerColor(i));
}
SetTimerEx("HideIcon",2000,0,"i",playerid);
}
return 1;
}
forward HideIcon(playerid);
public HideIcon(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
SetPlayerMarkerForPlayer(playerid, i, 00); // 00 = invisibile
}
}
}
Re: MapIcon help. -
Doppeyy - 24.06.2010
Looks like it works
im waiting for him now so we can test with 2 players.
Thanks for the help tho.
~Nookie
Re: MapIcon help. -
ReVo_ - 24.06.2010
Ok let me know
Re: MapIcon help. -
Doppeyy - 24.06.2010
Quote:
Originally Posted by [TLV
ReVo_ ]
Ok let me know
|
Nope know when i shoot the mapicon gets placed at him and when he shoots the mapicon gets placed at me.
~Nookie
Re: MapIcon help. -
[HiC]TheKiller - 24.06.2010
Make sure you are checking for a empty slot, I'd use a Icon streamer for this because [TLV]ReVo_ creates 200 map icons at the same place and uses up all the slots. Check my sig on how to make a Icon streamer.
Re: MapIcon help. -
Joe_ - 24.06.2010
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (newkeys & KEY_FIRE)
{
for(new a = 0, b = GetMaxPlayers(); a < b; a++)
{
SetPlayerMarkerForPlayer(playerid, a, GetPlayerColor(playerid));
SetTimerEx("HideIcon",2000,0,"i",playerid);
}
return 1;
}
return 1;
}
forward HideIcon(playerid);
public HideIcon(playerid)
{
for(new a = 0, b = GetMaxPlayers(); a < b; a++)
{
SetPlayerMarkerForPlayer(playerid, a, 00);
}
return 1;
}
I'm not very good with the markers lol, so I dunno if it'll work.
Re: MapIcon help. -
Doppeyy - 24.06.2010
Quote:
Originally Posted by [HiC
TheKiller ]
Make sure you are checking for a empty slot, I'd use a Icon streamer for this because [TLV]ReVo_ creates 200 map icons at the same place and uses up all the slots. Check my sig on how to make a Icon streamer.
|
Thanks but that didn't help me at all.
I asked how to make my code work not how to make a streamer.
~Nookie