Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --------The first code.
- CMD:ffind(playerid, params[])
- {
- if(PlayerInfo[playerid][pDuty] && IsACop(playerid))
- {
- //SendClientMessageEx(playerid, COLOR_RED, "* Listing all gates within 5 meters of you...");
- for(new i, Float: fGatePos[3], gateid, string[128], szMessage[32]; i < MAX_GATES; i++)
- {
- if(sscanf(params, "i", gateid))
- GetDynamicObjectPos(GateInfo[i][gGATE], fGatePos[0], fGatePos[1], fGatePos[2]);
- if(IsPlayerInRangeOfPoint(playerid, 5, fGatePos[0], fGatePos[1], fGatePos[2]))
- {
- if(GateInfo[i][gModel] != 0)
- {
- format(szMessage, sizeof(szMessage), "Gate ID %d (VW: %d)", i, GateInfo[i][gVW]);
- SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
- format(string,sizeof(string),"|___________ Password Gate (ID: %d) ___________|", gateid);
- format(string, sizeof(string), "PassWord Gate: %s", GateInfo[i][gPass]);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- }
- }
- }
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GRAD2, "Ban khong phai la nhan vien nha nuoc.");
- }
- return 1;
- }
- ------second code
- CMD:movegate(playerid, params[])
- {
- if(isnull(params)) return SendClientMessageEx(playerid, COLOR_GREY, "Su dung: /movegate [pass]");
- new Float:X, Float:Y, Float:Z;
- for(new i = 0; i < sizeof(GateInfo); i++)
- {
- GetDynamicObjectPos(GateInfo[i][gGATE], X, Y, Z);
- if (IsPlayerInRangeOfPoint(playerid,GateInfo[i][gRange], X, Y, Z))
- {
- if(strcmp(params, GateInfo[i][gPass], true) == 0)
- {
- if(GateInfo[i][gStatus] == 0)
- {
- MoveDynamicObject(GateInfo[i][gGATE], GateInfo[i][gPosXM], GateInfo[i][gPosYM], GateInfo[i][gPosZM], GateInfo[i][gSpeed], GateInfo[i][gRotXM], GateInfo[i][gRotYM], GateInfo[i][gRotZM]);
- GateInfo[i][gStatus] = 1;
- }
- else
- {
- MoveDynamicObject(GateInfo[i][gGATE], GateInfo[i][gPosX], GateInfo[i][gPosY], GateInfo[i][gPosZ], GateInfo[i][gSpeed], GateInfo[i][gRotX], GateInfo[i][gRotY], GateInfo[i][gRotZ]);
- GateInfo[i][gStatus] = 0;
- }
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement