15.03.2009, 19:43
(Ignore the GF referances, NOTHING to do with it)
So I was wondering if this was possible:
I made a command that resets all 'house cars' to one spot and that works but what if I want them to automatically go into a grid? Heres what I have so far but it doesn't work - just completes the first one over and over again non-stop.
So I was wondering if this was possible:
I made a command that resets all 'house cars' to one spot and that works but what if I want them to automatically go into a grid? Heres what I have so far but it doesn't work - just completes the first one over and over again non-stop.
pawn Код:
if(strcmp(cmd, "/rhc", true) == 0 || strcmp(cmd, "/resethousecars", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new Float:myx;
new Float:myy;
new Float:myz;
new Float:mya;
GetPlayerPos(playerid, myx, myy, myz);
GetPlayerFacingAngle(playerid, mya);
if(PlayerInfo[playerid][pAdmin] >= 1337)
for (new i=1;i<=250;i++)
for (new x=5;x<=25;x++)
for (new y=5;x<=5000;y++)
{
CribInfo[i][hCarLocX] = myx+x;
CribInfo[i][hCarLocY] = myy+y;
CribInfo[i][hCarLocZ] = myz;
CribInfo[i][hCarLocA] = mya;
SendClientMessage(playerid, COLOR_GREEN, "Start house car reset...");
SendClientMessage(playerid, COLOR_GREEN, "-------------------------");
format(string, sizeof(string), "Car %d reset to %d %d %d facing %d degrees.", i, myx, myy, myz, mya);
SendClientMessage(playerid, COLOR_GREEN, string);
print(string);
SendClientMessage(playerid, COLOR_GREEN, "-------------------------");
SendClientMessage(playerid, COLOR_GREEN, "House car reset complete!");
OnPropUpdate();
SendClientMessageToAll(COLOR_GREEN, "An admin reset all house car positions. See forum.");
}
else
{
SendClientMessage(playerid, 0xFF000000, "You are not authorized to use that command!");
}
}
return 1;
}