SA-MP Forums Archive
Big MoveObject. - 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)
+--- Thread: Big MoveObject. (/showthread.php?tid=293902)



Big MoveObject. - Super_Panda - 30.10.2011

So when that forward starts it crashes my game.

pawn Код:
forward fight(playerid);
public fight(playerid)
{
    for(new i = 0; i <= MAX_PLAYERS; i++)[html][/html]
    {
    new string[128];
    format( string, sizeof(string), "~w~Fi~g~gh~b~t~r~!");
    GameTextForAll( string, 5000, 3 );
    TogglePlayerControllable(i, 1);
    MoveObject(Gate1, 1781.30004883,-1980.40002441,55.000,2.0);
    MoveObject(Gate2, 1781.30004883,-1980.40002441,55.000,2.0);
    print("MOVING");
    }
}



Re: Big MoveObject. - SuperViper - 30.10.2011

pawn Код:
forward fight(playerid);
public fight(playerid)
{
    new string[128];
    format( string, sizeof(string), "~w~Fi~g~gh~b~t~r~!");
    GameTextForAll( string, 5000, 3 );
    TogglePlayerControllable(playerid, 1);
    MoveObject(Gate1, 1781.30004883,-1980.40002441,55.000,2.0);
    MoveObject(Gate2, 1781.30004883,-1980.40002441,55.000,2.0);
    print("MOVING");
}



Re: Big MoveObject. - Stigg - 30.10.2011

Edit: Misread sorry.


Respuesta: Big MoveObject. - Super_Panda - 30.10.2011

I need that one to be for every one, so I made a new one, Hole COde:

pawn Код:
forward Sin(playerid);
public Sin(playerid)
{
    SetTimer("tres", 1000, false);
    SetTimer("dos", 2000, false);
    SetTimer("uno", 3000, false);
    SetTimer("fight", 4000, false);
    SetTimer("move", 5000, false);
}
forward tres();
public tres()
{
    new string[128];
    format( string, sizeof(string), "~w~3");
    GameTextForAll( string, 5000, 3 );
}
forward dos();
public dos()
{
    new string[128];
    format( string, sizeof(string), "~w~2");
    GameTextForAll( string, 5000, 3 );
}
forward uno();
public uno()
{
    new string[128];
    format( string, sizeof(string), "~w~1");
    GameTextForAll( string, 5000, 3 );
}
forward fight(playerid);
public fight(playerid)
{
    for(new i = 0; i <= MAX_PLAYERS; i++)
    {
    new string[128];
    format( string, sizeof(string), "~w~Fi~g~gh~b~t~r~!");
    GameTextForAll( string, 5000, 3 );
    TogglePlayerControllable(i, 1);
    }
}
forward move(playerid);
public move(playerid)
{
    MoveObject(Gate1, 1781.30004883,-1980.40002441,55.000,2.0);
    MoveObject(Gate2, 1781.30004883,-1980.40002441,55.000,2.0);
    print("MOVING");
}



Respuesta: Big MoveObject. - Super_Panda - 30.10.2011

Please i think its ALL bugged, since I made a print and it shows like a million times each one like
USA
USA
USA
USA
CHINA
CHINA
CHINA
CHINA
IRAQ ETC.

pawn Код:
CMD:test(playerid, params[])
{
    {
        print("Hi");
        SetTimer("USA", 1000, false);
        SetTimer("CHINA", 1000, false);
        SetTimer("IRAQ", 1000, false);
        SetTimer("JAPAN", 1000, false);
        SetTimer("RUSSIA", 1000, false);
    }
    return 1;
}
forward USA;
public USA()
{
    for(new i = 0; i <= MAX_PLAYERS; i++)
    {
    if (Team(playerid) == TEAM_USA)
    {
   
         SetPlayerPos(i, 1800.2399902344,-1774.9396972656,52.46875);
         SetPlayerWorldBounds(i, 9999.9, -9999.9, 9999.9, -9999.9 );
         SetPlayerColor(i, COLOR_YELLOW);
         print("USA");
   
    }
    }
}
forward CHINA(playerid);
public CHINA(playerid)
{
    for(new i = 0; i <= MAX_PLAYERS; i++)
    {
    if (Team(playerid) == TEAM_CHINA)
    {

         SetPlayerPos(i, 1800.2399902344,-1774.9396972656,52.46875);
         SetPlayerWorldBounds(i, 9999.9, -9999.9, 9999.9, -9999.9 );
         SetPlayerColor(i, COLOR_YELLOW);
         print("China");


    }
    }
}
forward IRAQ(playerid);
public IRAQ(playerid)
{
    for(new i = 0; i <= MAX_PLAYERS; i++)
    {
    if (Team(playerid) == TEAM_IRAQ)
    {

         SetPlayerPos(i, 1800.2399902344,-1774.9396972656,52.46875);
         SetPlayerWorldBounds(i, 9999.9, -9999.9, 9999.9, -9999.9 );
         SetPlayerColor(i, COLOR_YELLOW);
         print("IRaQ");

    }
    }
}
forward JAPAN(playerid);
public JAPAN(playerid)
{
    for(new i = 0; i <= MAX_PLAYERS; i++)
    {
    if (Team(playerid) == TEAM_JAPAN)
    {

         SetPlayerPos(i, 760.9923095703,1782.1430664063,52.46875);
         SetPlayerWorldBounds(i, 9999.9, -9999.9, 9999.9, -9999.9 );
         SetPlayerColor(i, COLOR_GREEN);
         print("JAPAN");

    }
}
}
forward RUSSIA(playerid);
public RUSSIA(playerid)
{
    for(new i = 0; i <= MAX_PLAYERS; i++)
    {
    if (Team(playerid) == TEAM_RUSSIA)
    {

         SetPlayerPos(i, 760.9923095703,1782.1430664063,52.46875);
         SetPlayerWorldBounds(i, 9999.9, -9999.9, 9999.9, -9999.9 );
         SetPlayerColor(i, COLOR_GREEN);
         SetTimer("Paro", 1000, false);
         print("RUSSIA");
    }
}
}
forward Paro(playerid);
public Paro(playerid)
{
    for(new i = 0; i <= MAX_PLAYERS; i++)
    {
    TogglePlayerControllable(i, 0);
    SetTimer("Sin", 3000, false);
    print("PARO");
}
}
forward Sin(playerid);
public Sin(playerid)
{
    SetTimer("tres", 1000, false);
    SetTimer("dos", 2000, false);
    SetTimer("uno", 3000, false);
    SetTimer("fight", 4000, false);
    print("SIN");
   
}
forward tres();
public tres()
{
    new string[128];
    format( string, sizeof(string), "~w~3");
    GameTextForAll( string, 5000, 3 );
    print(string);
}
forward dos();
public dos()
{
    new string[128];
    format( string, sizeof(string), "~w~2");
    GameTextForAll( string, 5000, 3 );
    print(string);
}
forward uno();
public uno()
{
    new string[128];
    format( string, sizeof(string), "~w~1");
    GameTextForAll( string, 5000, 3 );
        print(string);
}
forward fight(playerid);
public fight(playerid)
{
    for(new i = 0; i <= MAX_PLAYERS; i++)
    {
    new string[128];
    format( string, sizeof(string), "~w~Fi~g~gh~b~t~r~!");
    GameTextForAll( string, 2000, 3 );
    TogglePlayerControllable(i, 1);
    print(string);
    SetTimer("move", 1000, false);
   
    }
}
forward move(playerid);
public move(playerid)
{
    new string[128];
    new movetime = MoveObject(Gate1, 1781.30004883,-1980.40002441,55.000, 2.00);
    format(string, sizeof(string), "Object will finish moving in %d milliseconds", movetime);
    SendClientMessageToAll(-1, string);
    MoveObject(Gate2, 1781.30004883,-1980.40002441,55.000,2.0);
    print("MOVING");
}
I will give $2 if you fix it.


Re: Big MoveObject. - Ricop522 - 30.10.2011

You can't use a print instead a for.
Use like that:

pawn Код:
public USA()
{
    for(new i = 0; i <= MAX_PLAYERS; i++)
    {
    if (Team(playerid) == TEAM_USA)
    {
   
         SetPlayerPos(i, 1800.2399902344,-1774.9396972656,52.46875);
         SetPlayerWorldBounds(i, 9999.9, -9999.9, 9999.9, -9999.9 );
         SetPlayerColor(i, COLOR_YELLOW);
   
   
    }
   
}
print("USA");
}
https://sampwiki.blast.hk/wiki/SetTimerEx