Jump to content

Question

Posted

Am si eu un FS cu masini personale si creez masina direct in joc si cand vreau sa o cumpar zice ca am deja o masina si eu nu am niciuna.

Uite comanda /v buy:

else if(strcmp(x_nr,"buy",true) == 0)
	        {
	            if(IsAnOwnableCar(idcar))
	            {
			    	if(PlayerInfo[playerid][pPcarkey] == -1) { }
			    	else { SendClientMessage(playerid, COLOR_GREY, "You have already car!"); return 1; }
					if(CarInfo[idcar][cOwned]==1)
					{
				    	SendClientMessage(playerid, COLOR_GREY, "Someone already owns this car");
				    	return 1;
					}
					if(GetPlayerMoney(playerid) >= CarInfo[idcar][cValue])
					{
					    if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = idcar; }
					    else { return 1; }
						CarInfo[idcar][cOwned] = 1;
						GetPlayerName(playerid, sendername, sizeof(sendername));
						strmid(CarInfo[idcar][cOwner], sendername, 0, strlen(sendername), 999);
						GivePlayerMoney(playerid,-CarInfo[idcar][cValue]);
						PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
						GameTextForPlayer(playerid, "~w~Congratulations~n~Do not forget to a park with /v park!", 5000, 3);
				        SendClientMessage(playerid, COLOR_GRAD2, "Congratulations you've bought a new car!");
				        SendClientMessage(playerid, COLOR_GRAD2, "Type: /mycarhelp for car manual!");
				        TogglePlayerControllable(playerid, 1);
						OnPropUpdate(); SavePlayerData(playerid);
						return 1;
					}
					else
					{
					    SendClientMessage(playerid, COLOR_GREY, "You don't have enough cash with you ! ");
					    return 1;
					}
	            }
	        }

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.