[HELP]Command /buyvehicle
#1

Ok when i do /buyvehicle it works perfectly and it shows the checkpoint,but the problem is the car is supposed to spawn to but it doesn't please help.

Код:
	if(strcmp(cmd, "/buyvehicle", true) == 0 || strcmp(cmd, "/vehicle", true) == 0) // By Ellis
	{
	  if(IsPlayerConnected(playerid))
	  {
	  	new vehid;
	new	vehicle[128];
	new idcar;
	new carid;
		new color1;
				color1 = strval(tmp);
		new color2;
				color2 = strval(tmp);

	  	new carkey = PlayerInfo[playerid][pPcarkey];
	new carkey2 = PlayerInfo[playerid][pPcarkey2];
	new carkey3 = PlayerInfo[playerid][pPcarkey3];
	new Float:plocx,Float:plocy,Float:plocz;

	    if(gPlayerLogged[playerid] == 0)
	    {
	      SendClientMessage(playerid, COLOR_GREY, "  You need to login first ! ");
	      return 1;
	    }
	    new x_nr[64];
	    x_nr = strtok(cmdtext, idx);
	    if(!strlen(x_nr))
	    {
	      SendClientMessage(playerid, COLOR_YELLOW3, "[/v] park, lock(1-3),/carlocate");
	      SendClientMessage(playerid, COLOR_YELLOW3, "[/v] sell, get(1-3), sellto, color, despawn(1-3)");
	      SendClientMessage(playerid, COLOR_YELLOW3, "[/v] /modcar /modlr /modst /carmod");
	      return 1;
	    }

	  	if(PlayerInfo[playerid][pPcarkey] == 999) { }
			  	else if(PlayerInfo[playerid][pPcarkey2] == 999) { }
			  	else if(PlayerInfo[playerid][pPcarkey3] == 999) { }
			  	else { SendClientMessage(playerid, COLOR_GREY, "  You already own 3 vehicles"); return 1; }
	    if(strcmp(x_nr,"sultan",true) == 0)
	    {
	     if(GetPlayerMoney(playerid) < 27495)
		  {
		    SendClientMessage(playerid, COLOR_WHITE, "You have insufficient funds.");
		  }
		  else
		  {
 						SetVehicleVirtualWorld(carid,0);
		SetVehiclePos(carid,plocx,plocy+4, plocz);
				CarInfo[vehid][cColorOne] = color1;
	        CarInfo[vehid][cColorTwo] = color2;
				PlayerInfo[playerid][pPcarkey] = 560;
				GivePlayerMoney(playerid, -27495);
				SetPlayerCheckpoint(playerid, 2119.0, -1166.5, 24.0, 10.0);
			   CarInfo[idcar][cOwned] = 1;
				SendClientMessage(playerid, COLOR_WHITE, "You have purchased a Sultan. Please head to the RED marker.");
				OnPropUpdate(playerid);
				OnPlayerUpdateX(playerid);



			}
		}
		else
		{
		  SendClientMessage(playerid, COLOR_WHITE, "Invalid car name.");
		}
	}
	return 1;
}
Reply
#2

is it sposed to CreateVehicle at all??
Reply
#3

It is supposed to create the sultan and spawn it
Reply
#4

So you mean that it should spawn a vehicle when the player types /buyvehicle Sultan ?
If so then you have forgot
pawn Код:
carid = CreateVehicle(......)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)