SA-MP Forums Archive
Vehicles Problem - 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)
+--- Thread: Vehicles Problem (/showthread.php?tid=526266)



Vehicles Problem - kirostar - 16.07.2014

Hey,

Yesterday i solved this problem, https://sampforum.blast.hk/showthread.php?tid=526121So, today i tried to add more vehicles but i couldn't add more than 1 vehicle, I tried to add 2 vehicles, and the 2nd vehicle is working, but the 1st is not

Help , i am tired from this problem!

Код:
CMD:war ( playerid )
{
 if ( PlayerInfo[playerid][inDM] == 1 ) return SendClientMessage( playerid, -1, ""RED"ERROR: "GREY"You are already in a DM arena! Type /leave to exit!" );
 PlayerInfo[playerid][inDM] = 1;
 PlayerInfo[playerid][inDMZone] = 2;
 gWARPlayers++;
 GameTextForPlayer(playerid, "~r~WAR DM!", 2000, 3);
 WarCar = AddStaticVehicle(432,229.1953,1810.3751,17.6499,359.9418,91,17); // /war
 WarCar = AddStaticVehicle(432,163.3929,1836.3821,17.6535,180.2394,7,51); // /war
 SendClientMessage(playerid, COLOR_FIREBRICK, "** Welcome to WAR DM!" );
 new Float:RandomSpawns[][] =
 {
  {336.9875,1822.0619,17.6406,88.7100},
  {123.5864,1819.3789,17.6406,346.1517},
  {135.2626,1935.9694,19.2690,174.2042}
 };
 if (IsPlayerInAnyVehicle(playerid))
 {
     RemovePlayerFromVehicle(playerid);
 }
 new Random = random(sizeof(RandomSpawns));
 SetPlayerPosition(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2], RandomSpawns[Random][3]);
 SetPlayerVirtualWorld(playerid, 64798);
 SetVehicleVirtualWorld(WarCar, 64798);
 SetCameraBehindPlayer(playerid);
 SetPlayerTeam(playerid, playerid);
 ResetPlayerWeapons(playerid);
 SetPlayerHealth(playerid, 100.0);
 if ( PlayerInfo[playerid][VIP] == 1 )
 {
  SetPlayerArmour(playerid, 100.0);
 }
 GiveWeaponSet( playerid, PlayerInfo[playerid][WeaponSet] );

 new str[128];
 format(str, sizeof(str), ""GREEN":: {%06x}%s(%d) "TELEPORTBLUE"teleported to War DM (/war)!", (GetPlayerColor(playerid) >>> 8), GetName(playerid), playerid);
 SendClientMessageToAll( -1, str );
 return 1;
}



Re: Vehicles Problem - IceBilizard - 16.07.2014

You must type news of your script like

pawn Код:
new WarCar2;
pawn Код:
CMD:war ( playerid )
{
 if ( PlayerInfo[playerid][inDM] == 1 ) return SendClientMessage( playerid, -1, ""RED"ERROR: "GREY"You are already in a DM arena! Type /leave to exit!" );
 PlayerInfo[playerid][inDM] = 1;
 PlayerInfo[playerid][inDMZone] = 2;
 gWARPlayers++;
 GameTextForPlayer(playerid, "~r~WAR DM!", 2000, 3);
 WarCar = AddStaticVehicle(432,229.1953,1810.3751,17.6499,359.9418,91,17); // /war
 WarCar2 = AddStaticVehicle(432,163.3929,1836.3821,17.6535,180.2394,7,51); // /war
 SendClientMessage(playerid, COLOR_FIREBRICK, "** Welcome to WAR DM!" );
 new Float:RandomSpawns[][] =
 {
  {336.9875,1822.0619,17.6406,88.7100},
  {123.5864,1819.3789,17.6406,346.1517},
  {135.2626,1935.9694,19.2690,174.2042}
 };
 if (IsPlayerInAnyVehicle(playerid))
 {
     RemovePlayerFromVehicle(playerid);
 }
 new Random = random(sizeof(RandomSpawns));
 SetPlayerPosition(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2], RandomSpawns[Random][3]);
 SetPlayerVirtualWorld(playerid, 64798);
 SetVehicleVirtualWorld(WarCar, 64798);
 SetCameraBehindPlayer(playerid);
 SetPlayerTeam(playerid, playerid);
 ResetPlayerWeapons(playerid);
 SetPlayerHealth(playerid, 100.0);
 if ( PlayerInfo[playerid][VIP] == 1 )
 {
  SetPlayerArmour(playerid, 100.0);
 }
 GiveWeaponSet( playerid, PlayerInfo[playerid][WeaponSet] );

 new str[128];
 format(str, sizeof(str), ""GREEN":: {%06x}%s(%d) "TELEPORTBLUE"teleported to War DM (/war)!", (GetPlayerColor(playerid) >>> 8), GetName(playerid), playerid);
 SendClientMessageToAll( -1, str );
 return 1;
}