Wysłany: 2013-10-26, 13:29
awfesa
Wiek: 29 Na forum: 4705 dni Posty: 563
Piwa : 223
Witam znalaz?em w necie taki skrypt na stref? ?mierci w wojsku ?e tam mo?na zabija? z wi?kszych broni ale po wej?ciu do "wojska" nic si? nie dzieje a powinno da? bro? i pojawi? si? napis ze jeste? w strefie
Oto ten kod:
Kod: #include <a_samp>
#if defined FILTERSCRIPTS
new Wstrefie[200];
public OnPlayerConnect(playerid)
{
Wstrefie[playerid]=false;
return 1;
}
public OnGameModeInit()
{
SetTimer("StrefaWojska", 1500, true);
return 1;
}
forward StrefaWojska();
public StrefaWojska()
{
for(new i=0; i<200; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInArea(i, 314.2947, 1805.4396, 17.6406))
{
if (Wstrefie==false)
{
Wstrefie=true;
SendClientMessage(i,0xFF0000FF,"Wszed?es do strefy wojska!" );
}
}
}
else
{
if(Wstrefie==true)
{
SendClientMessage(i,0xFF0000FF,"Opu?ci?e? teren wojska, wyrzutnia rakiet zosta?a odebrana.!" );
ResetPlayerWeapons(i);
Wstrefie=false;
GivePlayerWeapon(i, 28 , 999999);
GivePlayerWeapon(i, 26 , 999999);
GivePlayerWeapon(i, 31 , 999999);
}
}
}
}
forward IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy);
public IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(x > minx && x < maxx && y > miny && y < maxy) return 1;
return 0;
}
#endif
za pomoc oczywi?cie
Podpis
Cokolwiek robicie w swoim życiu, nie będzie to legendarne,
jeżeli wasi przyjaciele nie będą mogli tego zobaczyć.
Więcej szczegółów
Wystawiono 2 piw(a):Patryk86125 , XDDDDDDDDDDDDD0
Wysłany: 2013-10-27, 16:05
Sillence
Wiek: 26 Na forum: 5157 dni Posty: 1514
Nick w MP: Sillence
Piwa : 1517
awfesa , W tym kodzie brakuje ostatniego argumentu 'maxy'
Kod: if(IsPlayerInArea(i, 314.2947, 1805.4396, 17.6406))
Je?eli uzupe?nisz ju? podany argument to popraw go r?wnie? w kodzie:
Kod: #include <a_samp>
new bool:Wstrefie;
public OnPlayerConnect(playerid)
{
Wstrefie=false;
return 1;
}
public OnFilterScriptInit()
{
SetTimer("StrefaWojska", 1500, true);
return 1;
}
forward StrefaWojska();
public StrefaWojska()
{
for(new i=0; i<200; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInArea(i, 314.2947, 1805.4396, 17.6406))
{
if (Wstrefie==false)
{
Wstrefie=true;
SendClientMessage(i,0xFF0000FF,"Wszed?es do strefy wojska!" );
}
}
else
{
if(Wstrefie==true)
{
SendClientMessage(i,0xFF0000FF,"Opu?ci?e? teren wojska, wyrzutnia rakiet zosta?a odebrana.!" );
ResetPlayerWeapons(i);
Wstrefie=false;
GivePlayerWeapon(i, 28 , 999999);
GivePlayerWeapon(i, 26 , 999999);
GivePlayerWeapon(i, 31 , 999999);
}
}
}
}
return 1;
}
IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(x > minx && x < maxx && y > miny && y < maxy) return 1;
return 0;
}
Tagi: strefa
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: