Jump to content
  • 0

pomoc Include


LukasB

Dotaz

4 odpovědí na tuto otázku

Recommended Posts

  • 0

Áno, môže to byť aj tak, ako to má on, ale keď sa bude učiť s návodov, vo väčšine bude ten tvar ktorý som napísal ja, preto aby sa mu to nemýlilo.

Link to comment
Share on other sites

  • 0

praveze error to hadze a hento som nastial na nete ale v include to neni


je to len v zloske hodene

a ked to chcem dat do fiilescriptu pod awx tak mi to nechce zkompilovat a ma to chyby a vsetci pisu ze to ide 


Takto vyzerá ten  script :

 

 

//==============================|
#include <a_samp>
//==============================|
#define MAX_ICONS_EX        70
#define MAX_SHOWED_MAPICONS  70
#define MAX_PLAYERS_EX       30
//==============================|
new Float:XM[MAX_ICONS_EX];
new Float:YM[MAX_ICONS_EX];
new Float:ZM[MAX_ICONS_EX];
 
new MarkerM[MAX_ICONS_EX];
new ColorM[MAX_ICONS_EX];
 
new IsValid[MAX_ICONS_EX];
new Show[MAX_PLAYERS_EX][MAX_ICONS_EX];
 
new IconidM   =-1;
new Set_Timer = 0;
new Count     = 0;
new ShowedForPlayer[MAX_PLAYERS_EX];
//------------------------------
//==============================|
forward StreamIcons();
//==============================================================|
//==============================================================|
stock CreateMapIcon(markerid, color, Float:X, Float:Y, Float:Z)
{
if(Set_Timer == 0)
{
SetTimer("StreamIcons", 1000, true);
Set_Timer = 1;
}
if (IconidM >= MAX_ICONS_EX) return 0;
IconidM++;
IsValid[IconidM] = 1;
XM[IconidM]      = X;
YM[IconidM]      = Y;
ZM[IconidM]      = Z;
MarkerM[IconidM] = markerid;
ColorM[IconidM]  = color;
  printf(" %d",IconidM);
for(new i=0; i<MAX_PLAYERS_EX; i++)
{
Show[i][IconidM] = 1;
}
return IconidM;
}
//==============================================================|
stock IsValidMapIcon(iconid)
{
if (IsValid[iconid] == 1) return 1;
return 0;
}
///==============================================================|
stock GetMapIconPos(iconid, &Float:X, &Float:Y, &Float:Z)
{
if(!IsValidMapIcon(iconid)) return 0;
X=XM[iconid];
Y=YM[iconid];
Z=ZM[iconid];
return 1;
}
//==============================================================|
public StreamIcons()
{
ForPlayers(i)
{
if(IsPlayerConnected(i))
{
ShowedForPlayer[i] = 0;
for(new oldm=0; oldm < 32; oldm++) RemovePlayerMapIcon(i, oldm);
Count = 0;
for(new m=0; m<IconidM; m++)
{
if(IsValidMapIcon(m))
{
if(ShowedForPlayer[i] < MAX_SHOWED_MAPICONS)
{
if(Show[i][m] == 1)
{
if(GetDistanceToMapIcon(i, m) <= 999999)
{
SetPlayerMapIcon(i, Count, XM[m], YM[m], ZM[m], MarkerM[m], ColorM[m]);
ShowedForPlayer[i]++;
Count++;
}
}
}
}
}
}
}
return 1;
}
//==============================================================|
stock GetDistanceToMapIcon(playerid, iconid)
{
new Float:x1,Float:y1,Float:z1;
new Float:x2,Float:y2,Float:z2;
new Float:output;
GetPlayerPos(playerid, x1, y1, z1);
GetMapIconPos(iconid, x2, y2, z2);
output = floatsqroot(floatpower(floatabs(floatsub(x2, x1)), 2)+floatpower(floatabs(floatsub(y2, y1)), 2));
return floatround(output);
}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...