[HELP] Derby Invisble Car - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Derby Invisble Car (
/showthread.php?tid=195853)
[HELP] Derby Invisble Car -
NotoriousMOB - 03.12.2010
Im trying to make a derby minigame in one place
works fine from doing /derby you will spawn at the place but.. your car is invisble
i been trying to change the VirtualWorld but without luck hope some of you can help me out.
Picture:
/imageshack/img14/258/derbyr.png
Code:
Код:
if(strcmp(cmd, "/derby", true) == 0)
{
if(derbyplaying == 1)
{
SendClientMessage(playerid, 0xB4B5B7AA, "The derby is already started");
return 1;
}
if(playerinminigame[playerid] == 1)
{
SendClientMessage(playerid, 0xB4B5B7AA, "You are already in a minigame");
return 1;
}
new pname[256];
GetPlayerName(playerid, pname, 256);
if(derbyon == 0)
{
derbyon = 1;
playerinminigame[playerid] = 1;
playerinderby[playerid] = 1;
derbyrank = 1;
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
SetVehicleVirtualWorld(bloodring[0],0);
bloodringfull[0] = 1;
PutPlayerInVehicle(playerid, bloodring[0], 0);
playerinbloodring[playerid] = 0;
TogglePlayerControllable(playerid, 0);
startvar[0] = 1;
dtimer = SetTimer("StartDerby", 60000, 0);
format(string, sizeof(string), "%s has started a derby, you have one minute to type /derby and join", pname);//
SendClientMessageToAll(0x33AA33AA,string);
return 1;
} else if(derbyon == 1 && derbyrank < 15) {
playerinminigame[playerid] = 1;
playerinderby[playerid] = 1;
derbyrank++;
SetPlayerInterior(playerid,0);
for(new i=0; i<15; i++)
{
if(bloodringfull[i] == 0)
{
SetPlayerVirtualWorld(playerid,0);
SetVehicleVirtualWorld(bloodring[i],0);
bloodringfull[i] = 1;
PutPlayerInVehicle(playerid, bloodring[i], 0);
TogglePlayerControllable(playerid, 0);
playerinbloodring[playerid] = i;
format(string, sizeof(string), "%s has joined the derby", pname);//
SendClientMessageToAll(0x33AA33AA,string);
return 1;
}
}
} else if(derbyon == 1 && derbyrank >= 15) {
format(string, sizeof(string), "The derby is full, wait for the next round", pname);//
SendClientMessage(playerid,0x33AA33AA,string);
return 1;
}
}
Re: [HELP] Derby Invisble Car -
Axuj - 03.12.2010
Maybe you must try this function?
https://sampwiki.blast.hk/wiki/LinkVehicleToInterior
Re: [HELP] Derby Invisble Car -
scripter1 - 03.12.2010
Like Axuj stated, you need to use the LinkVehicleToInterior function. Add this into your command:
pawn Код:
LinkVehicleToInterior(vehicleid, 0);
Re: [HELP] Derby Invisble Car -
NotoriousMOB - 03.12.2010
It's not working i have this aswell ?
Код:
public Spawnbloodrings()
{
for(new i=0; i<15; i++)
{
bloodring[i] = CreateVehicle(504,derbycars[i][0],derbycars[i][1],derbycars[i][2],derbycars[i][3],-1,-1,-1);
LinkVehicleToInterior(bloodring[i],15);
SetVehicleVirtualWorld(bloodring[i],1);
bloodringfull[i] = 0;
}
return 1;
}
Re: [HELP] Derby Invisble Car -
scripter1 - 03.12.2010
You don't need the VirtualWorld, and change
pawn Код:
LinkVehicleToInterior(bloodring[i],15);
to
pawn Код:
LinkVehicleToInterior(bloodring[i],0);
to make the car visible.
Re: [HELP] Derby Invisble Car -
NotoriousMOB - 03.12.2010
Thank you so much appreciate it man