Hmm.. little problem in making car system.
#1

im trying to made car system that you from somespot, that what i did.


Код:
    	if(strcmp(cmd, "/buyveh", true) == 0)
	    {
	        if(PlayerInfo[playerid][pLevel] < 3)
			  	{
          	SendClientMessage(playerid, COLOR_GREY, "You need to be level 3 to buy a vehicle!");
          	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(CarInfo[idcar][cOwned]==1)
					{
				  	SendClientMessage(playerid, COLOR_GREY, "Someone already owns this car");
				  	return 1;
					}
					if(GetPlayerMoney(playerid) >= 10000)
					{
					  if(PlayerInfo[playerid][pPcarkey] == 999) { PlayerInfo[playerid][pPcarkey] = idcar; }
					  else if(PlayerInfo[playerid][pPcarkey2] == 999) { PlayerInfo[playerid][pPcarkey2] = idcar; }
					  else if(PlayerInfo[playerid][pPcarkey3] == 999) { PlayerInfo[playerid][pPcarkey3] = idcar; }
					  else { return 1; }
					  if(PlayerToPoint(50,playerid,1657.3835,-1705.8860,15.6094)){
					  AddStaticVehicleEx(402,1657.3835,-1705.8860,15.6094,9.1468,0,0,60000);
						CarInfo[idcar][cOwned] = 1;
            GetPlayerName(playerid, sendername, sizeof(sendername));
						strmid(CarInfo[idcar][cOwner], sendername, 0, strlen(sendername), 999);
						SafeGivePlayerMoney(playerid,-10000);
						PlayerPlayMusic(playerid);
						GameTextForPlayer(playerid, "~w~Congratulations~n~Don't forget to /buypark it!", 5000, 3);
						SendClientMessage(playerid, COLOR_GRAD2, "Congratulations on your new purchase!");
						SendClientMessage(playerid, COLOR_GRAD2, "Type /vehiclehelp or /vehhelp to view the vehicle manual!");
						SendClientMessage(playerid, COLOR_YELLOW2, "You can start the engine up now !");
						gEngine[playerid] = 0;
						engineOn[GetPlayerVehicleID(playerid)] = false;
						DateProp(playerid);
						OnPropUpdate();
						OnPlayerUpdate(playerid);
						}
						return 1;
					}
					else
					{
					  SendClientMessage(playerid, COLOR_GREY, " You don't have enough cash with you ! ");
					  return 1;
					}
	    }
that code only for buying one model, but when i type it in the point its not create nothing.
Reply
#2

Check this: https://sampwiki.blast.hk/wiki/AddStaticVehicle
and this: https://sampwiki.blast.hk/wiki/CreateVehicle

You need CreateVehicle instead of AddStaticVehicle

Hail to wiki!!
Reply
#3

I dont understand the diffrence between CreateVehicle and AddStaticVehicle

They do the same thing right?
Reply
#4

CreateVehicle that if you are interested in creating vehicles during game-runtime.
Reply
#5

Quote:
Originally Posted by Ben147
CreateVehicle that if you are interested in creating vehicles during game-runtime.
oh
Reply
#6

But still i have a problem its create the vehicle but not chaning the carowner
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)