Little question about gate
#1

Hello, i have this peace of code
Код:
if(!strcmp(cmdtext, "/gateopen", true))
{
  if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3)
  {
    if (PlayerToPoint(15, playerid,1589.053344,-1638.123168,14.122960))
		{
   		MoveObject(pdgate1,1599.053344,-1638.123168,14.122960, 0.8);
   		SetTimer("GateClose", 12000, 0);
   		SendClientMessage(playerid, COLOR_BLUE," Āīљīņą ēąźљīћņń˙ чељеē 7 ńеźуķд.");
   		GetPlayerName(playerid, sendername, sizeof(sendername));
   		format(string, sizeof(string), "* %s īņźљūė āīљīņą.", sendername);
   		ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
   		PlayerPlaySound(playerid, 1153, 1589.053344,-1638.123168,14.122960);
I want to use the horn button, and not write - /gateopen, what should i change?
Reply
#2

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (newkeys == KEY_SPRINT)
    {
        //Add your code here
    }
}
Reply
#3

Huh I thought the horn key could not be used, similar to CONVERSATION_NO/CONVERSATION_YES (N/Y keys).
Reply
#4

Yeah, that key might not be right, but just an example how to use keys.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)