SA-MP Forums Archive
Float 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: Float Help (/showthread.php?tid=106833)



Float Help - Nameless303 - 05.11.2009

Hi!

On top of my gamemode there is;
Код:
new Float:WarLoc[2][4] =
	{
		{1.1,1.1,1.1,1.1}, // loc1
		{1.1,1.1,1.1,1.1} // loc2
	};
I use it for the spawn location of the players;
Код:
	AddPlayerClassEx(TEAM_GROVE, 105, WarLoc[0][0], WarLoc[0][1], WarLoc[0][2], WarLoc[0][3], 0, 0, 0, 0, 0, 0);
	AddPlayerClassEx(TEAM_GROVE, 106, WarLoc[0][0], WarLoc[0][1], WarLoc[0][2], WarLoc[0][3], 0, 0, 0, 0, 0, 0);
	AddPlayerClassEx(TEAM_GROVE, 107, WarLoc[0][0], WarLoc[0][1], WarLoc[0][2], WarLoc[0][3], 0, 0, 0, 0, 0, 0);
	AddPlayerClassEx(TEAM_BALLAS, 102, WarLoc[0][0], WarLoc[0][1], WarLoc[0][2], WarLoc[0][3], 0, 0, 0, 0, 0, 0);
	AddPlayerClassEx(TEAM_BALLAS, 103, WarLoc[0][0], WarLoc[0][1], WarLoc[0][2], WarLoc[0][3], 0, 0, 0, 0, 0, 0);
	AddPlayerClassEx(TEAM_BALLAS, 104, WarLoc[0][0], WarLoc[0][1], WarLoc[0][2], WarLoc[0][3], 0, 0, 0, 0, 0, 0);
So now I wan't to make a command so I can change the spawn location in-game...

Please help me (:
Thanks!


Re: Float Help - Daren_Jacobson - 06.11.2009

using dcmd&sscanf

pawn Код:
dcmd_ChangeSpawn(playerid, params[])
{
  new level1, level2, Float:val;
  if (sscanf(params, "iif", level1, level2, val)) SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /ChangeSpawn [loc-1] [x=0 y=1...] [value]");
  else
    WarLoc[level1][level2] = val;
  return 1;
}



Re: Float Help - Nameless303 - 06.11.2009

Quote:
Originally Posted by Daren_Jacobson
using dcmd&sscanf

pawn Код:
dcmd_ChangeSpawn(playerid, params[])
{
  new level1, level2, Float:val;
  if (sscanf(params, "iif", level1, level2, val)) SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /ChangeSpawn [loc-1] [x=0 y=1...] [value]");
  else
    WarLoc[level1][level2] = val;
  return 1;
}
k Thanks! It works (: