SA-MP Forums Archive
Array 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: Array help (/showthread.php?tid=90926)



Array help - sggassasin - 11.08.2009

hey there i need to make a player to point arrary useing this code



Код:
if(!strcmp("/rob", cmdtext, true) && PlayerToPoint(10 ,playerid,372.8418,-8.6437,1001.8516))
 {
  if(IfPlayerIsRobed[playerid] == 0)
  {
  new pName[MAX_PLAYER_NAME];
  new string[48];
  GetPlayerName(playerid, pName, sizeof(pName));
  format(string, sizeof(string), "%s hase stolen some money", pName);
	GivePlayerMoney(playerid, 10000); // Give the player the money
  SetPlayerWantedLevel(playerid, 5);
  SendClientMessageToAll(0xDEEE20FF, string);
  IfPlayerIsRobed[playerid] = 1;
  SetTimerEx("RobWaitTimer", 10000, 0, "i", playerid);
}
else if(IfPlayerIsRobed[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "You Have Already Robed Plz Wait");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not in area");
}



Re: Array help - RSX - 11.08.2009

What's the problem, just save all coords in 3 arrays
new RobX[]={
1.000000,
2.000000
};
new RobY[]={
3.000000,
4.000000
};
new RobZ[]={
5.000000,
6.000000
};
If it's just one, then you can do like this
enum Axis
{
X,
Y,
Z
};
new RobCoords[Axis];
Using : RobCoords[X]=value and so on...