19.02.2009, 05:07
The multiple cars in the title, is what i will be doing later.
I'm trying to make this command, move all the houses in a straight line, but + metres.
Obviously i've done something wrong, but i thought this would work.
For example:
[ME] - I then do the command.
[ME] - [CAR] [CAR] [CAR] [CAR] [CAR] [CAR]
pawn Код:
if(strcmp(cmd, "/masshousemove", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] >= 20)
{
for(new i = 0; i < sizeof(Houses); i++)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
new Float:metres = 1.0;
metres += 1.0;
Houses[i][EnterX] = metres+x;
Houses[i][EnterY] = y;
Houses[i][EnterZ] = z;
Houses[i][EnterWorld] = GetPlayerVirtualWorld(playerid);
Houses[i][EnterInterior] = GetPlayerInterior(playerid);
new Float:angle;
GetPlayerFacingAngle(playerid, angle);
Houses[i][EnterAngle] = angle;
DestroyPickup(Houses[i][PickupID]);
if(Houses[i][Owned] == 0)
{
Houses[i][PickupID] = CreatePickup(1273, 1, Houses[i][EnterX], Houses[i][EnterY], Houses[i][EnterZ]);
}
else if(Houses[i][Owned] == 1)
{
Houses[i][PickupID] = CreatePickup(1239, 1, Houses[i][EnterX], Houses[i][EnterY], Houses[i][EnterZ]);
}
//format(string, sizeof(string), "%f", metres);
//SendClientMessage(playerid,COLOR_ADMINCMD, string);
//SaveHouses();
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Your not an administrator.");
}
return 1;
}
Obviously i've done something wrong, but i thought this would work.
For example:
[ME] - I then do the command.
[ME] - [CAR] [CAR] [CAR] [CAR] [CAR] [CAR]