Spawning cars in interiors, Need help.
#1

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
Reply
#2

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;
	     }
	}
Reply
#3

This the command I needed. Thanks!
Reply
#4

No problem i was looking for my problem with saving cars in file and in my script stand that code
Reply
#5

when i use your script my Pawn keeps crashing lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)