and i want now that 6 of my cars have godmode can someone help me?
new GodCars[6];
//OnGameModeInit
GodCars[0] = AddStaticVehicle(Blah blahj blah);
GodCars[1] = AddStaticVehicle(Blah blahj blah);
GodCars[2] = AddStaticVehicle(Blah blahj blah);
//etc...
SetVehicleHealth(GodCars[0], 100000);
SetVehicleHealth(GodCars[1], 100000);
SetVehicleHealth(GodCars[2], 100000);
//etc...
//OnVehicleSpawn
if(vehicleid == GodCars[0])
{
SetVehicleHealth(GodCars[0], 100000);
}
if(vehicleid == GodCars[1])
{
SetVehicleHealth(GodCars[1], 100000);
}
//etc...
new GodCars[6];
GodCars[0] = AddStaticVehicleEx(411,1507.6937,1174.0288,326.1282,359.4708,116,1, 20); // infe lv GodCars[1] = AddStaticVehicleEx(411,1504.5143,1174.0742,326.1289,359.1254,112,1, 20); // infe lv 1 GodCars[2] = AddStaticVehicleEx(411,1501.4204,1174.0099,326.1299,359.5850,106,1, 20); // infe lv GodCars[3] = AddStaticVehicleEx(411,1495.9490,1173.9745,326.1282,359.8535,80,1, 20); // infe lv GodCars[4] = AddStaticVehicleEx(411,1492.8213,1174.0062,326.1282,359.4546,75,1, 20); // infe lv GodCars[5] = AddStaticVehicleEx(411,1489.5162,1173.9971,326.1259,0.3766,12,1, 20); // infe lv
public OnVehicleSpawn(vehicleid)
{
if(vehicleid == GodCars[0])
{
SetVehicleHealth(GodCars[0], 100000);
}
if(vehicleid == GodCars[1])
{
SetVehicleHealth(GodCars[1], 100000);
}
if(vehicleid == GodCars[2])
{
SetVehicleHealth(GodCars[2], 100000);
}
if(vehicleid == GodCars[3])
{
SetVehicleHealth(GodCars[3], 100000);
}
if(vehicleid == GodCars[4])
{
SetVehicleHealth(GodCars[4], 100000);
}
if(vehicleid == GodCars[5])
{
SetVehicleHealth(GodCars[5], 100000);
}
}
|
Originally Posted by Seif_
You too.
pawn Код:
|
Anyways, error is in one word
|
Originally Posted by Schock
wont work i addet it like this:
Код:
new GodCars[6]; Код:
GodCars[0] = AddStaticVehicleEx(411,1507.6937,1174.0288,326.1282,359.4708,116,1, 20); // infe lv GodCars[1] = AddStaticVehicleEx(411,1504.5143,1174.0742,326.1289,359.1254,112,1, 20); // infe lv 1 GodCars[2] = AddStaticVehicleEx(411,1501.4204,1174.0099,326.1299,359.5850,106,1, 20); // infe lv GodCars[3] = AddStaticVehicleEx(411,1495.9490,1173.9745,326.1282,359.8535,80,1, 20); // infe lv GodCars[4] = AddStaticVehicleEx(411,1492.8213,1174.0062,326.1282,359.4546,75,1, 20); // infe lv GodCars[5] = AddStaticVehicleEx(411,1489.5162,1173.9971,326.1259,0.3766,12,1, 20); // infe lv Код:
public OnVehicleSpawn(vehicleid)
{
if(vehicleid == GodCars[0])
{
SetVehicleHealth(GodCars[0], 100000);
}
if(vehicleid == GodCars[1])
{
SetVehicleHealth(GodCars[1], 100000);
}
if(vehicleid == GodCars[2])
{
SetVehicleHealth(GodCars[2], 100000);
}
if(vehicleid == GodCars[3])
{
SetVehicleHealth(GodCars[3], 100000);
}
if(vehicleid == GodCars[4])
{
SetVehicleHealth(GodCars[4], 100000);
}
if(vehicleid == GodCars[5])
{
SetVehicleHealth(GodCars[5], 100000);
}
}
|
|
Originally Posted by Schock
it dont work ... can someone post a working part?
|
forward IsAGodCars(carid);
new GodCars1(carid);
new GodCars2(carid);
public IsAGodCars(carid)
{
if(carid == GodCars1 || carid == GodCars2)
{
return 1;
}
return 0;
}
Ongamemodeinit:
GodCars1 = CreateVehicle(411,1507.6937,1174.0288,326.1282,359.4708,116,1, 20,300000); // infe lv
GodCars2 = CreateVehicle(411,1504.5143,1174.0742,326.1289,359.1254,112,1, 20,300000); // infe lv 1
public OnVehicleSpawn(vehicleid)
{
if(IsAGodCars(vehicleid))
{
DestroyVehicle(vehicleid);
if(vehicleid == GodCars1)
{CreateVehicle(411,1507.6937,1174.0288,326.1282,359.4708,116,1, 20,300000); }
else if(vehicleid == GodCars2)
{CreateVehicle(411,1504.5143,1174.0742,326.1289,359.1254,112,1, 20,300000);}
SetVehicleHealth(vehicleid, 2000); // Set Car HP 2000
}
return 1;
}