31.08.2010, 12:23
For some people, There mod shop is bugged, you go in, then someone else goes in behind you, And then your both crashing into eachother in the mod shop.
Well here is how i fixed the bug for my server (Not sure if it happens to everyone, but i thought i'd share).
First, The callback.
Search in your GameMode/Filterscript for
Next, directly under the first curly bracket
Add this code.
So at end, it will look like..
Now let me explain what everything does.
The callback.
The variable
The virtual worlds.
PutPlayerInVehicle(playerid, CARID, seat);
For more information on PutPlayerInVehicle, Click this line.
The "if" Statement.
And there you go. Very simple tut to a very annoying bug i kept running into.
Well here is how i fixed the bug for my server (Not sure if it happens to everyone, but i thought i'd share).
First, The callback.
Search in your GameMode/Filterscript for
pawn Code:
public OnEnterExitModShop(playerid, enterexit, interiorid)
{
return 1;
}
pawn Code:
{
pawn Code:
new vehid;
vehid = GetPlayerVehicleID(playerid);
SetPlayerVirtualWorld(playerid, random(555)+random(999));
SetVehicleVirtualWorld(vehid, GetPlayerVirtualWorld(playerid));
PutPlayerInVehicle(playerid, vehid, 0);
if(enterexit == 0)
{
SetVehicleVirtualWorld(vehid, 0);
SetPlayerVirtualWorld(playerid, 0);
PutPlayerInVehicle(playerid, vehid, 0);
}
pawn Code:
public OnEnterExitModShop(playerid, enterexit, interiorid)
{
new vehid;
vehid = GetPlayerVehicleID(playerid);
SetPlayerVirtualWorld(playerid, random(555)+random(999));
SetVehicleVirtualWorld(vehid, GetPlayerVirtualWorld(playerid));
PutPlayerInVehicle(playerid, vehid, 0);
if(enterexit == 0)
{
SetVehicleVirtualWorld(vehid, 0);
SetPlayerVirtualWorld(playerid, 0);
PutPlayerInVehicle(playerid, vehid, 0);
}
return 1;
}
Now let me explain what everything does.
The callback.
pawn Code:
public OnEnterExitModShop(playerid, enterexit, interiorid)
{
//This is where your code/script/data gets processed/executed ingame.
return 1;
}
pawn Code:
new vehid; //Setting the variable for the players car to save to
pawn Code:
SetPlayerVirtualWorld(playerid, random(555)+random(999)); //Sets the players virtual world
SetVehicleVirtualWorld(vehid, GetPlayerVirtualWorld(playerid)); //Puts his car, in his virtual world
pawn Code:
PutPlayerInVehicle(playerid, vehid, 0); //Puts the player in vehicle.
The "if" Statement.
pawn Code:
if(enterexit == 0)
{
//This checks it the player has EXITED, the mod garage (1 for enter)
//And then script/code gets put in here.
}