Some Questions - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Some Questions (
/showthread.php?tid=181790)
Some Questions -
andershh - 07.10.2010
I got a couple of questions i cant figure out myself, im not a good scripter, but im not directly NOOB, so please dont be mean or something like that.
1.) When the hitman kills his contract/finishes his hit, he earns the money, but the victim doesnt loose that much money as he supposes to do, he looses like $350 when the contract was $600,000, how can i fix that?
2.) When i do /invite, the player accepts the invitation automatically, how can i make an /accept faction appear to the victim?
3.) Another hitman thing, how can i make an /accept hit, after the director/R4+ uses /givehit to me? Like, you type givehit 3, and the victim should get '****_**** offers you an hit, type /accept hit to accept it' etc.
4.) How can i add an timer to my /ad, like, if someone posts an /ad, you'll have to wait 50 seconds to post another one.
Thats all, thanks alot for you bother reading this.
Re: Some Questions -
andershh - 07.10.2010
bump.....
Re: Some Questions -
Babul - 07.10.2010
for the 2 hitman things, we could need some code(s) plz.
for the timer problem in the /ad theres a simple solution w/o any timer.
in the /ad command, do it like:
Код:
if(GetTickCount()-GetPVarInt(playerid,"LastAdTime")<50000)
{
SendClientMessage(playerid,0xaa5555ff,"Wait 50 seconds before advertising again.");
return 1;
}
else
{
SetPVarInt(playerid,"LastAdTime",GetTickCount));
//do your ad
}
doing the /invite works the same way (except theres not a time, but an ID). simply set the invited players PVar to the playerid who sent the inv, then check if the /accepting player GOT an invite (his ID could be in the GetPVarInt(playerid,"InvitedByID")... after you set it indeed