SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 03/09/2011, 08:56 AM   #1
[EDT]AmanSingh123
Big Clucker
 
Join Date: Oct 2010
Posts: 153
Reputation: 1
Default need help on setting players interior from 0 to 12 every 0.4 seconds...

Hi....

top
pawn Code:
forward objectreload();


gamemodeinit
pawn Code:
SetTimer("objectreload", 400, 1);



public objectreload
pawn Code:
public objectreload()
{
  ........
}



i dont know what to put in the public and i want it so the player interior and the vehicle interior is set to 12 then right back to 0 over and over again..... and also that it's instant so the player doesnt really notice this..

..the reason is if you do this you wont get the invisible object bug....
[EDT]AmanSingh123 is offline   Reply With Quote
Old 03/09/2011, 08:59 AM   #2
FireCat
High-roller
 
FireCat's Avatar
 
Join Date: Jul 2010
Posts: 2,322
Reputation: 609
Default Re: need help on setting players interior from 0 to 12 every 0.4 seconds...

pawn Code:
public objectreload()
{
    if(GetPlayerInterior(playerid) == 12) return SetPlayerInterior(playerid,0);
    SetPlayerInterior(playerid,GetPlayerInterior(playerid)+1);
    return 1;
}
FireCat is offline   Reply With Quote
Old 03/09/2011, 09:04 AM   #3
[EDT]AmanSingh123
Big Clucker
 
Join Date: Oct 2010
Posts: 153
Reputation: 1
Default Re: need help on setting players interior from 0 to 12 every 0.4 seconds...

also i want
pawn Code:
LinkVehicleToInterior(vehicle1, [the interior id])

so it doesnt make the car flicker you know...
[EDT]AmanSingh123 is offline   Reply With Quote
Old 03/09/2011, 09:18 AM   #4
[EDT]AmanSingh123
Big Clucker
 
Join Date: Oct 2010
Posts: 153
Reputation: 1
Default Re: need help on setting players interior from 0 to 12 every 0.4 seconds...

Quote:
pawn Code:
public objectreload()
{
    for(new playerid; playerid < MAX_PLAYERS; ++playerid)
    {
        if(IsPlayerConnected(playerid))
        if(GetPlayerInterior(playerid) == 12)
            return SetPlayerInterior(playerid,0);
        SetPlayerInterior(playerid,GetPlayerInterior(playerid)+1);
    }
    return 1;
}

also thats a bit weird because it's on interior 12 and goes to 0 then back to 12 again.... i want it the opposite so its on interior 0 and goes to 12 and back to 0 so you can see the original map properly aswell...
[EDT]AmanSingh123 is offline   Reply With Quote
Old 03/09/2011, 09:21 AM   #5
FireCat
High-roller
 
FireCat's Avatar
 
Join Date: Jul 2010
Posts: 2,322
Reputation: 609
Default Re: need help on setting players interior from 0 to 12 every 0.4 seconds...

Quote:
Originally Posted by Nathy.SA-MP View Post
undefined symbol 'playerid'.

pawn Code:
public objectreload()
{
    for(new playerid; playerid < MAX_PLAYERS; ++playerid)
    {
        if(IsPlayerConnected(playerid))
        if(GetPlayerInterior(playerid) == 12)
            return SetPlayerInterior(playerid,0);
        SetPlayerInterior(playerid,GetPlayerInterior(playerid)+1);
    }
    return 1;
}
Ups
pawn Code:
public objectreload()
{
    for(new playerid; playerid < MAX_PLAYERS; ++playerid)
    {
        if(GetPlayerInterior(playerid) == 12) return SetPlayerInterior(playerid,0);
        SetPlayerInterior(playerid,GetPlayerInterior(playerid)+1);
        if(IsPlayerInAnyVehicle(playerid)) LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(playerid)+1)
    }
    return 1;
}
FireCat is offline   Reply With Quote
Old 03/09/2011, 09:30 AM   #6
[EDT]AmanSingh123
Big Clucker
 
Join Date: Oct 2010
Posts: 153
Reputation: 1
Default Re: need help on setting players interior from 0 to 12 every 0.4 seconds...

Quote:
pawn Code:
public objectreload()
{
    for(new playerid; playerid < MAX_PLAYERS; ++playerid)
    {
        if(GetPlayerInterior(playerid) == 12) return SetPlayerInterior(playerid,0);
        SetPlayerInterior(playerid,GetPlayerInterior(playerid)+1);
        if(IsPlayerInAnyVehicle(playerid)) LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(playerid)+1)
    }
    return 1;
}

bug: on normal map it's invisible and goes to interior 0 for like a split second and the car goes invsible for a split second aswell....

isnt their another of fixing the object bug in a timer for example using
pawn Code:
Streamer_Update(playerid);
or either
pawn Code:
Streamer_UpdateEx(playerid, Float:x, Float:y, Float:z);
[EDT]AmanSingh123 is offline   Reply With Quote
Old 03/09/2011, 09:32 AM   #7
FireCat
High-roller
 
FireCat's Avatar
 
Join Date: Jul 2010
Posts: 2,322
Reputation: 609
Default Re: need help on setting players interior from 0 to 12 every 0.4 seconds...

Quote:
Originally Posted by [EDT]AmanSingh123 View Post
bug: on normal map it's invisible and goes to interior 0 for like a split second and the car goes invsible for a split second aswell....

isnt their another of fixing the object bug in a timer for example using
pawn Code:
Streamer_Update(playerid);
or either
pawn Code:
Streamer_UpdateEx(playerid, Float:x, Float:y, Float:z);
Try:
pawn Code:
public objectreload()
{
    for(new playerid; playerid < MAX_PLAYERS; ++playerid)
    {
        SetPlayerInterior(playerid,GetPlayerInterior(playerid)+1);
        if(IsPlayerInAnyVehicle(playerid)) LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(playerid)+1)
    }
    return 1;
}
FireCat is offline   Reply With Quote
Old 03/09/2011, 09:45 AM   #8
[EDT]AmanSingh123
Big Clucker
 
Join Date: Oct 2010
Posts: 153
Reputation: 1
Default Re: need help on setting players interior from 0 to 12 every 0.4 seconds...

Quote:
pawn Code:
public objectreload()
{
    for(new playerid; playerid < MAX_PLAYERS; ++playerid)
    {
        SetPlayerInterior(playerid,GetPlayerInterior(playerid)+1);
        if(IsPlayerInAnyVehicle(playerid)) LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(playerid)+1)
    }
    return 1;
}

nope :/
[EDT]AmanSingh123 is offline   Reply With Quote
Old 03/09/2011, 10:26 AM   #9
[EDT]AmanSingh123
Big Clucker
 
Join Date: Oct 2010
Posts: 153
Reputation: 1
Default Re: need help on setting players interior from 0 to 12 every 0.4 seconds...

okay so i changed to fallouts streamer and i want to try this.....
pawn Code:
public objectreload()
{
    for(new playerid; playerid < MAX_PLAYERS; ++playerid)
    {
      F_PlayerObjectUpdate(playerid, Float:x, Float:y, Float:z);
    }
    return 1;
}


but i get this error... and dont know how to resolve it.... :/

pawn Code:
error 017: undefined symbol "x"
[EDT]AmanSingh123 is offline   Reply With Quote
Old 03/09/2011, 10:55 AM   #10
Pinguinn
Huge Clucker
 
Join Date: Aug 2011
Location: The Netherlands
Posts: 313
Reputation: 34
Default Re: need help on setting players interior from 0 to 12 every 0.4 seconds...

pawn Code:
public objectreload()
{
    new Float:x, Float:y, Float:z;
    for(new playerid; playerid < MAX_PLAYERS; ++playerid)
    {
      GetPlayerPos(playerid, x, y, z);
      F_PlayerObjectUpdate(playerid, x, y, z);
    }
    return 1;
}
Pinguinn 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
Help with setting Caligula interior Jacob_Cameron Help Archive 3 11/06/2011 08:05 PM
setting a virtual world for each interior on each different vehicle Haydz Help Archive 6 22/11/2010 09:29 AM
setting a checkpoint for a spicific interior? Owenlishious Help Archive 4 21/06/2010 04:53 AM
[help]setting an interior to a vahecle[help] krisko Help Archive 5 26/08/2009 05:51 PM


All times are GMT. The time now is 06:42 AM.


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