SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 30/10/2011, 02:07 PM   #1
Super_Panda
Big Clucker
 
Join Date: Sep 2011
Posts: 147
Reputation: 0
Default Big MoveObject.

So when that forward starts it crashes my game.

pawn Code:
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");
    }
}

Super_Panda is offline   Reply With Quote
Old 30/10/2011, 02:17 PM   #2
SuperViper
High-roller
 
SuperViper's Avatar
 
Join Date: Sep 2011
Posts: 1,217
Reputation: 310
Default Re: Big MoveObject.

pawn Code:
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");
}
SuperViper is offline   Reply With Quote
Old 30/10/2011, 02:19 PM   #3
Stigg
High-roller
 
Stigg's Avatar
 
Join Date: Aug 2010
Location: Other side of the Universe.
Posts: 2,085
Reputation: 111
Default Re: Big MoveObject.

Edit: Misread sorry.
__________________

Peace...

Stigg is offline   Reply With Quote
Old 30/10/2011, 02:25 PM   #4
Super_Panda
Big Clucker
 
Join Date: Sep 2011
Posts: 147
Reputation: 0
Default Respuesta: Big MoveObject.

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

pawn Code:
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");
}
Super_Panda is offline   Reply With Quote
Old 30/10/2011, 03:01 PM   #5
Super_Panda
Big Clucker
 
Join Date: Sep 2011
Posts: 147
Reputation: 0
Default Respuesta: Big MoveObject.

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 Code:
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.
Super_Panda is offline   Reply With Quote
Old 30/10/2011, 03:14 PM   #6
Ricop522
High-roller
 
Ricop522's Avatar
 
Join Date: Feb 2010
Location: ES
Posts: 2,697
Reputation: 148
Default Re: Big MoveObject.

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

pawn Code:
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");
}
http://wiki.sa-mp.com/wiki/SetTimerEx
__________________
"Any fool can write code that a
computer can understand. Good
programmers write code that
humans can understand."

Sistemas de Informação, IFES
Ricop522 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MoveObject bug Artie_Scorpion Scripting Help 2 18/10/2011 04:48 PM
MoveObject lukas567 Scripting Help 2 03/10/2011 04:33 AM
MoveObject... ColdXX Română/Romanian 3 18/04/2010 12:34 PM


All times are GMT. The time now is 07:40 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.