Float Help
#1

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!
Reply
#2

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;
}
Reply
#3

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 (:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)