SA-MP Forums Archive
Send a dcmd command when press key?Rep+ - 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: Send a dcmd command when press key?Rep+ (/showthread.php?tid=339374)



Send a dcmd command when press key?Rep+ - Admigo - 03.05.2012

Heey all,

How can i make this command:
Код:
dcmd_payticket(playerid,params);//the command dont use params
to a key?

Thanks Admigo


Re: Send a dcmd command when press key?Rep+ - Admigo - 03.05.2012

Will this help when i am not using params?
Код:
if (newkeys & KEY_SPRINT && newkeys & KEY_SUBMISSION)
{
  	dcmd_payticket(playerid,IntToStr(playerid));
	return 1;
}



Re: Send a dcmd command when press key?Rep+ - HighPitchedVoice - 03.05.2012

Yes, I believe so if I am not wrong.


Re: Send a dcmd command when press key?Rep+ - MadeMan - 03.05.2012

This would be better

pawn Код:
if (newkeys & KEY_SPRINT && newkeys & KEY_SUBMISSION)
{
    dcmd_payticket(playerid,"");
    return 1;
}
Also, do you want both keys to be pressed or only one?


Re: Send a dcmd command when press key?Rep+ - Accord - 03.05.2012

In public "OnPlayerCommandText":
Код:
dcmd(payticket,9,cmdtext);
and in your mode:
Код:
dcmd_payticket(playerid,params[]) 
{ 
    #pragma unused params 
    return SendClientMessage(playerid,-1,"you have paid your ticket."); 
}



Re: Send a dcmd command when press key?Rep+ - Admigo - 03.05.2012

Quote:
Originally Posted by Accord
Посмотреть сообщение
In public "OnPlayerCommandText":
Код:
dcmd(payticket,9,cmdtext);
and in your mode:
Код:
dcmd_payticket(playerid,params[]) 
{ 
    #pragma unused params 
    return SendClientMessage(playerid,-1,"you have paid your ticket."); 
}
Dude,i know how to make dcmd commands....
@MadeMan both buttons but i dont see any message of the command.


Re: Send a dcmd command when press key?Rep+ - Accord - 03.05.2012

So what is your question sir? how to make a payticket command?


Re: Send a dcmd command when press key?Rep+ - MadeMan - 03.05.2012

There is a difference:

pawn Код:
if (newkeys & KEY_SPRINT && newkeys & KEY_SUBMISSION)
means you are pressing KEY_SPRINT and KEY_SUBMISSION together
pawn Код:
if (newkeys & KEY_SPRINT || newkeys & KEY_SUBMISSION)
means you are pressing KEY_SPRINT or KEY_SUBMISSION only