A Little Help for coding my command /derby
#1

Hi for all.

First of all let me introduce myself: I am Darkmirages, I love sa-mp and everything that is part of this fantastic multiplayer

I would try to make a /derby with spawn different and the same is true for the machines, now I give you the codes:
Derby CMD:
Код:
if (strcmp("/derby", cmdtext, true, 10) == 0)
        {
	  Derby = true; // it is only a bool that says the player is in derby or not
          new vehicle1234;
          new randDD = random(sizeof(RandomDerby));
	  new randDDC = random(sizeof(RandomDerbyCar));
	  vehicle1234=CreateVehicle(RandomDerbyCar[randDDC],RandomDerby[randDD],3,3);
          SetVehicleNumberPlate(vehicle1234,"R.S. Derby");
          PutPlayerInVehicle(playerid,vehicle1234,0);
                return 1;
        }
RandomDerby Float Function:
Код:
new Float:RandomDerby[][] =
{
	"2897.8269,529.6500,2.5237",
	"2889.0015,488.2032,2.2507",
	"2987.7334,430.6239,10.5206",
	"3032.1719,430.1425,21.0622",
	"2991.8635,429.5412,38.8972"
};
RandomDerbyCar Float Function:
Код:
new Float:RandomDerbyCar[][] =
{
	"411","400","573","549","451",
	"541","542","545","556","559"
};
Where I'm wrong? what is or what are my mistakes? I hope that you know how to solve them ...

Thanks for reading
Reply
#2

SetPlayerPos search it on ****** i would do it for u but im on my phone
Reply
#3

check this

pawn Код:
new randderby = random(sizeof(RandomDerby));
        SetPlayerPos(playerid, RandomDerby[rand][0], RandomDerby[rand][1], RandomDerby[rand][2]);
        SetPlayerFacingAngle(playerid, RandomDerby[3]);
and do the same in the vehicle part.
Reply
#4

What is not working...?
I'm not sure but I think derby has an interior, so you need to change the vehicle interior and the player interior?
Reply
#5

You are identifying the information in the arrays as float values, but you're making them strings by adding the quotation marks. The correct way would be this:

pawn Код:
new Float:RandomDerby[][] =
{
    {2897.8269,529.6500,2.5237},
    {2889.0015,488.2032,2.2507},
    {2987.7334,430.6239,10.5206},
    {3032.1719,430.1425,21.0622},
    {2991.8635,429.5412,38.8972}
};
And as for the other one, remove the quotation marks and get rid of the Float: tag. I didn't look at the other code though, but I believe someone gave you a working piece.
Reply
#6

Thanks for RealCop228, problem resolved, close this topic please
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)