Storing Money in Vehicle
#1

Hey.I am trying to make a cmd that allows players to store money in vehicle but i dont know whats wrong with it.
i get no errors at pawno but when i go in game i press the command and it doesnt ask me for amount that i want to put .


here is my script

Код:
COMMAND:store(playerid, params[])
{
 new tmp[300], iAmount;
 if(sscanf(params, "s", tmp, iAmount)) return SCP(playerid, "/(money) [Amount]");
 new car = GetPlayerNearestVehicle(playerid);
	if(GetDistanceFromPlayerToVehicle(playerid, car) > 5.0)
		return SendClientError(playerid, "There is no vehicle around you!");
 if(!strcmp(tmp, "money", true , 7 ))
	{
		if(iAmount > HandMoney(playerid)) return SendClientError(playerid, " You dont have that amount of cash in hand ");
		{
		HandMoney(playerid) -= iAmount;
		comps[car][money] += iAmount;
		SendClientMessage(playerid, COLOR_GREEN, " You have succesfuly stored money in the vehicle " );
		return 1;
		}
	 }
Reply
#2

You forgot to add the string size and the integer in the format parameter
PHP код:
sscanf(params"s[300]d"tmpiAmount
Also reduce the string size, 300 is way to big, use something small like 32
Reply
#3

you didnt get me.
the problem is that it wont ask me for amount that i want to put in vehicle
example it should be like /store money "amount" 13000 ex
but when i do it, it only sends me message "you have successfuly stored cash in vehicle etc"
that is
Reply
#4

You kinda sound stupid, because command just does what its made to do, it not living thing thats asks amount, you have make it by yourself.
Reply
#5

You can use a dialog for instance, to ask if the player whether wants to store 5k or 50k. the cmd isn't going to ask it if it's not even scripted within.
Reply
#6

@code that what i need help with , i need to know how to make it ask for amount ..

@saff ill try it making with dialog that is a good idea thanks for it gonna try later.
Reply
#7

Quote:
Originally Posted by ThatFag
Посмотреть сообщение
@code that what i need help with , i need to know how to make it ask for amount ..

@saff ill try it making with dialog that is a good idea thanks for it gonna try later.
Nah, no problem man. if you're facing any issues feel free to ask it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)