13.07.2012, 12:51
Hello guys. I've made a filterscript that makes me a PD gate. Now I want to allow only PD officers to use it.
Here is the the Faction strict:
Here is my filterscript file:
It is Dialog. If it is not able to be made on the filterscript I was thinking about inserting something in the gamemode that check the faction, and if it is ok, allow to use the cmd, if not SendClientMessage ...
Here is the the Faction strict:
Код:
if (PlayerInfo[playerid][pMember] == 6)
Код:
#include <a_samp> #define dgate_1 1 #define ownermsg1 2 new gate; public OnFilterScriptInit() { gate = CreateObject(976,-2275.8000488281, 2348.8000488281, 3.7999999523163, 0.0, 0.0, 56); //Add this on the top of the scrip below the defines // new gate; //then add // gate = your object } // public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/gateopen", cmdtext, true, 10) == 0) { ShowPlayerDialog(playerid, dgate_1, DIALOG_STYLE_LIST, "Dialog Gate Options", "Open Gate \nClose Gate \nHouse Owner \n Teleport", " Choose Option ", ""); return 1; } return 0; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid==dgate_1) { if(response) { if(listitem == 0)//Open Gate { MoveObject(gate,-2275.8000488281, 2348.8000488281, 0.3999999523163 ,0.50); } if(listitem == 1)//Close Gate { MoveObject(gate,-2275.8000488281, 2348.8000488281, 3.7999999523163,0.50); } if(listitem == 2) //Owner Info Opention { ShowPlayerDialog(playerid, ownermsg1, DIALOG_STYLE_MSGBOX, "Notice", "Name: \n Job: \n Staff Member:", "Okay", "Then"); } if(listitem == 3)//Teleport Option { SetPlayerInterior (playerid, 0); SetPlayerPos(playerid, 1497.2285, -707.8083, 98.0334 ); } } return 1; } return 0; }