SA-MP Forums Archive
Bugs :S [Solved] - 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: Bugs :S [Solved] (/showthread.php?tid=97094)



Bugs :S [Solved] - speedruntrainer - 12.09.2009

Ok, So I'm making a teleport to the 8-track stadium which requies you to be in a vehile to use this command.
But I have 2 problems.

When you try to teleport to 8-track on foot, It still sets your interior and saying a message, 'Welcome to the 8-track stadium.' AND 'You need to be in a vehicle to use this command.'
You aren't teleported to the 8-track yet as it blocks the teleport when you are on foot.

And another problem is when you are in a vehicle, Everything is alright EXCEPT, The vehicle is invisible.

This is my code:

pawn Код:
if(strcmp(cmdtext, "/8-track", true) == 0) {
ResetPlayerWeapons(playerid);
SendClientMessage(playerid, COLOR_GREEN1, "Welcome to the 8-track race.");
SetPlayerInterior(playerid, 7);
LinkVehicleToInterior(playerid, 7);
if(IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid), -1399.23, -218.98, 1043.14);
else SendClientMessage(playerid, red, "You need to be in a vehicle to use this command");
return 1;
}
Can anybody help? Thanks.




Re: Bugs :S - JaTochNietDan - 12.09.2009

Try wrapping it up a bit more, looks cleaner too.

pawn Код:
if(strcmp(cmdtext, "/8-track", true) == 0)
{
   if(IsPlayerInAnyVehicle(playerid))
   {
     SetVehiclePos(GetPlayerVehicleID(playerid), -1399.23, -218.98, 1043.14);
     LinkVehicleToInterior(GetPlayerVehicleID(playerid), 7);
     ResetPlayerWeapons(playerid);
     SendClientMessage(playerid, COLOR_GREEN1, "Welcome to the 8-track race.");
     SetPlayerInterior(playerid, 7);
   }
   else
   {
     SendClientMessage(playerid, red, "You need to be in a vehicle to use this command");
   }
   return 1;
}



Re: Bugs :S [Solved] - speedruntrainer - 12.09.2009

Thanks Even if it's easy, This idea just not comes up in my mind. Thanks again
Have a nice weekend.