Big MoveObject.
#1

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");
    }
}
Reply
#2

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

Edit: Misread sorry.
Reply
#4

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");
}
Reply
#5

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.
Reply
#6

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
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)