Car spawn with new information. - 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: Car spawn with new information. (
/showthread.php?tid=196440)
Car spawn with new information. -
Biesmen - 05.12.2010
When a car explodes, I want it to respawn with the new information.. But it won't do that.
It will spawn with the new information until the server restarts.
- Information = Coordinates, color -
This is the code I use.
pawn Код:
public OnVehicleDeath(vehicleid)
{
for(new i; i < sizeof(COwnerData); i++)
{
if(vehicleid == COwnerData[i][CarID])
{
DestroyVehicle(COwnerData[i][CarID]);
COwnerData[i][CarID] = CreateVehicle(COwnerData[i][ModelID], COwnerData[i][carX], COwnerData[i][carY], COwnerData[i][carZ], COwnerData[i][carRot], COwnerData[i][pC1], COwnerData[i][sC2], 30*10000);
}
}
return 1;
}
To save the color, for example, I made a command which will change the file (dini_IntSet) and modify the COwnerData[i] by using this: COwnerData[i][pC1] = color1;, COwnerdata[i][sC2] = color2;.