PDA

View Full Version : need help on setting players interior from 0 to 12 every 0.4 seconds...


[EDT]AmanSingh123
03/09/2011, 08:56 AM
Hi....

top
forward objectreload();


gamemodeinit
SetTimer("objectreload", 400, 1);



public objectreload
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.... :)

FireCat
03/09/2011, 08:59 AM
public objectreload()
{
if(GetPlayerInterior(playerid) == 12) return SetPlayerInterior(playerid,0);
SetPlayerInterior(playerid,GetPlayerInterior(playe rid)+1);
return 1;
}

[EDT]AmanSingh123
03/09/2011, 09:04 AM
also i want LinkVehicleToInterior(vehicle1, [the interior id])

so it doesnt make the car flicker you know... :)

[EDT]AmanSingh123
03/09/2011, 09:18 AM
public objectreload()
{
for(new playerid; playerid < MAX_PLAYERS; ++playerid)
{
if(IsPlayerConnected(playerid))
if(GetPlayerInterior(playerid) == 12)
return SetPlayerInterior(playerid,0);
SetPlayerInterior(playerid,GetPlayerInterior(playe rid)+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...

FireCat
03/09/2011, 09:21 AM
undefined symbol 'playerid'.


public objectreload()
{
for(new playerid; playerid < MAX_PLAYERS; ++playerid)
{
if(IsPlayerConnected(playerid))
if(GetPlayerInterior(playerid) == 12)
return SetPlayerInterior(playerid,0);
SetPlayerInterior(playerid,GetPlayerInterior(playe rid)+1);
}
return 1;
}

Ups :D

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

[EDT]AmanSingh123
03/09/2011, 09:30 AM
public objectreload()
{
for(new playerid; playerid < MAX_PLAYERS; ++playerid)
{
if(GetPlayerInterior(playerid) == 12) return SetPlayerInterior(playerid,0);
SetPlayerInterior(playerid,GetPlayerInterior(playe rid)+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 Streamer_Update(playerid); or either Streamer_UpdateEx(playerid, Float:x, Float:y, Float:z);

FireCat
03/09/2011, 09:32 AM
AmanSingh123;1381873']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 Streamer_Update(playerid); or either Streamer_UpdateEx(playerid, Float:x, Float:y, Float:z);

Try:

public objectreload()
{
for(new playerid; playerid < MAX_PLAYERS; ++playerid)
{
SetPlayerInterior(playerid,GetPlayerInterior(playe rid)+1);
if(IsPlayerInAnyVehicle(playerid)) LinkVehicleToInterior(GetPlayerVehicleID(playerid) ,GetPlayerInterior(playerid)+1)
}
return 1;
}

[EDT]AmanSingh123
03/09/2011, 09:45 AM
public objectreload()
{
for(new playerid; playerid < MAX_PLAYERS; ++playerid)
{
SetPlayerInterior(playerid,GetPlayerInterior(playe rid)+1);
if(IsPlayerInAnyVehicle(playerid)) LinkVehicleToInterior(GetPlayerVehicleID(playerid) ,GetPlayerInterior(playerid)+1)
}
return 1;
}



nope :/

[EDT]AmanSingh123
03/09/2011, 10:26 AM
okay so i changed to fallouts streamer and i want to try this.....

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.... :/

error 017: undefined symbol "x"

Pinguinn
03/09/2011, 10:55 AM
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;
}

[EDT]AmanSingh123
03/09/2011, 11:09 AM
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;
}


thanks... but invisible bug stil isnt fixed :/ man this is hard to fix :P