Spawning cars in interiors, Need help. - 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: Spawning cars in interiors, Need help. (
/showthread.php?tid=92168)
Spawning cars in interiors, Need help. -
Antiono_Costa - 18.08.2009
I have this script that spawns you a car on command. But in places such as arenas it just stays invisible even if it says to link the interior to the vehicle...
Код:
if(strcmp(cmd, "/aspawncar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, "You're not the sufficient administrators rank.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "SYNTAX - /aspawncar [carid]");
return 1;
}
new car;
car = strval(tmp);
if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_WHITE, "IDs must be between 400 and 611."); return 1; }
new Float:XX, Float:YY, Float:ZZ;
GetPlayerPos(playerid, XX,YY,ZZ);
new carsp = CreateVehicle(car, XX,YY,ZZ, 0.0, random(126), random(126), -1);
LinkVehicleToInterior(carsp, GetPlayerInterior(playerid));
}
return 1;
}
EDIT: Its bit messed up, but its not because of that, something in the code
Re: Spawning cars in interiors, Need help. -
CAR - 18.08.2009
I use this in my script, something changed to yout script
Код:
if(strcmp(cmd, "/aspawncar", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] > 3)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_BLAUW, "GERBUIK: /aspawncar <modelid>");
}
else
{
new car;
car = strval(tmp);
if(car < 400 || car > 611) return { SendClientMessage(playerid, COLOR_WHITE, "IDs must be between 400 and 611."); return 1; }
new VehicleID,Float:X,Float:Y,Float:Z, Float:Angle,int1; GetPlayerPos(playerid, X,Y,Z); GetPlayerFacingAngle(playerid,Angle); int1 = GetPlayerInterior(playerid);
LinkVehicleToInterior(VehicleID,int1);
}
return 1;
}
}
Re: Spawning cars in interiors, Need help. -
bubka3 - 18.08.2009
This the command I needed. Thanks!
Re: Spawning cars in interiors, Need help. -
CAR - 18.08.2009
No problem i was looking for my problem with saving cars in file and in my script stand that code
Re: Spawning cars in interiors, Need help. -
Antiono_Costa - 19.08.2009
when i use your script my Pawn keeps crashing lol