Hey Leute,
habe jetzt meine Race Map fertig gemappt und wollte dieser jetzt noch die Funktionen scripten.
Doch folgende Warnings welche verhindern, dass die Cars bei einem Pickup gaändert werden:
I:\Testserver\gamemodes\DM.pwn(684) : warning 219: local variable "Infernus" shadows a variable at a preceding level
I:\Testserver\gamemodes\DM.pwn(697) : warning 219: local variable "Infernus" shadows a variable at a preceding level
I:\Testserver\gamemodes\DM.pwn(710) : warning 219: local variable "Infernus" shadows a variable at a preceding level
I:\Testserver\gamemodes\DM.pwn(723) : warning 219: local variable "Infernus" shadows a variable at a preceding level
I:\Testserver\gamemodes\DM.pwn(734) : warning 219: local variable "Hunter" shadows a variable at a preceding level
I:\Testserver\gamemodes\DM.pwn(748) : warning 219: local variable "NRG" shadows a variable at a preceding level
I:\Testserver\gamemodes\DM.pwn(761) : warning 219: local variable "NRG" shadows a variable at a preceding level
I:\Testserver\gamemodes\DM.pwn(774) : warning 219: local variable "NRG" shadows a variable at a preceding level
Code:
if(pickupid == Infernus[0])
{
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicle) == 522) // 411 is the infernus model
{
DestroyVehicle(vehicle);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
new Infernus = CreateVehicle(411, x, y, z, 0.0000, -1, -1, 100);
PutPlayerInVehicle(playerid,Infernus,0);
}
}
else if(pickupid == Infernus[1])
{
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicle) == 522) // 411 is the infernus model
{
DestroyVehicle(vehicle);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
new Infernus = CreateVehicle(411, x, y, z, 0.0000, -1, -1, 100);
PutPlayerInVehicle(playerid,Infernus,0);
}
}
else if(pickupid == Infernus[2])
{
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicle) == 522) // 411 is the infernus model
{
DestroyVehicle(vehicle);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
new Infernus = CreateVehicle(411, x, y, z, 0.0000, -1, -1, 100);
PutPlayerInVehicle(playerid,Infernus,0);
}
}
else if(pickupid == Infernus[3])
{
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicle) == 522) // 411 is the infernus model
{
DestroyVehicle(vehicle);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
new Infernus = CreateVehicle(411, x, y, z, 0.0000, -1, -1, 100);
PutPlayerInVehicle(playerid,Infernus,0);
}
}
else if(pickupid == Hunter)
{
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicle) == 411) // 411 is the infernus model
{
DestroyVehicle(vehicle);
new Hunter = CreateVehicle(425, -3939.1460, 3331.2786, 483.8146, 0.0000, -1, -1, 100);
PutPlayerInVehicle(playerid,Hunter,0);
SendClientMessage(playerid,0xFFFFFFFF,"Du hast den Hunter erreicht!");
}
}
else if(pickupid == NRG[1])
{
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicle) == 411) // 411 is the infernus model
{
DestroyVehicle(vehicle);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
new NRG = CreateVehicle(411, x, y, z, 0.0000, -1, -1, 100);
PutPlayerInVehicle(playerid,NRG,0);
}
}
else if(pickupid == NRG[2])
{
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicle) == 411) // 411 is the infernus model
{
DestroyVehicle(vehicle);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
new NRG = CreateVehicle(411, x, y, z, 0.0000, -1, -1, 100);
PutPlayerInVehicle(playerid,NRG,0);
}
}
else if(pickupid == NRG[0])
{
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicle) == 411) // 411 is the infernus model
{
DestroyVehicle(vehicle);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
new NRG = CreateVehicle(411, x, y, z, 0.0000, -1, -1, 100);
PutPlayerInVehicle(playerid,NRG,0);
}
}
Kann mir vielleicht jemand helfen?
Mit freundlichen Grüßen .:Larso99:.