SA-MP Forums Archive
Need a little help :( - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need a little help :( (/showthread.php?tid=384004)



Need a little help :( - MatZZPL - 09.10.2012

Hi everyone, I'm making my role play gamemode for a while now, maybe week or two few hours a day. I learned alot but obviously not enough I was wondering how can i make a job, or simply command that allows the target id to accept and then the function effects him, for eg takes his money.

What I'm looking for is creating a simple command for example I type in /heal id PRICEEEE and if I'm in the ambulance car and so is he it will send him an offer to get healed for that "PRICE". Doesn't have to be a heal one, as long as you include the way you send him an offer what functions and stuff.

Would be veryyy happy and grateful if someone could help me. Obvs will +rep for help.


Re: Need a little help :( - Riddick94 - 09.10.2012

Using sscanf and some command processor (i hope you using Zeex's command processor) you can make it easily. Use an if statement with sscanf which will check for targetid and price for heal, then if the statement pass it go threw and check is the playerid (seller) in ambulance car. If yes send an offer to target player.


Re: Need a little help :( - MatZZPL - 09.10.2012

I am Makes life much easier for me

Could you write a quick code for me? Dw about the bit if he's in ambulance and if hes a medic just a simple offer and when player accepts it heals him please? I know I'm asking a bit much

Btw cheers for a very quick answer!

@ i tried but i just can't think of a way how to put it all together ;/


Re: Need a little help :( - Riddick94 - 09.10.2012

Use an if statement i told you and use a functions for that like "IsPlayerInAnyVehicle" or "IsPlayerInVehicle" or.. GetPlayerState function. You need only if statement to complete this command. Look for functions how they're working on Wiki and statements if you got problem with it.


Re: Need a little help :( - MatZZPL - 09.10.2012

"If yes send an offer to target player." is there a function for that? That's the bit i don't understand


Re: Need a little help :( - Riddick94 - 09.10.2012

No, that's how if statement works. There can be only response for YES and NO. Learn how the 'if' works. You need to know exclamation mark, lower, lower and equal, higher, higher and equal, equal, different. Check for it on Wiki page.


Re: Need a little help :( - MatZZPL - 09.10.2012

I know about those really well if thats what you mean https://sampwiki.blast.hk/wiki/Control_S...res#for_.28.29

But i don't know what function to use for the player to type in /accept and for it to allow the changes to be done, i don't know if I'm making it harder then it is :/

is there any functions that read what the target id says? For example if(PlayerSays(targetid)


Re: Need a little help :( - Riddick94 - 09.10.2012

No! I didn't said anything about the loops. I told you about if statement. It's the first thing from the top of this site which you given. https://sampwiki.blast.hk/wiki/Control_Structures#if
And on the top of this site you got links for other places in Wiki. Look for Scripting functions and go there and look for functions what you need.


Re: Need a little help :( - MatZZPL - 09.10.2012

Ohh, would i be something like if player the seller has sent it to the customer, the costumer need a whole differenc command ?

So
CMDell
if ......
....
...
CMD:accepthealt
Getplayermoney
sethealt 100
....

@ Ok, im seriously confused now :/


Re: Need a little help :( - Riddick94 - 09.10.2012

Yes, you can do this on seperate commands. But you can do this based on Dialogs, textdraws, text.. whatever you want.