Advertisement
BanhVo

Untitled

Oct 5th, 2018
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. --------The first code.
  2. CMD:ffind(playerid, params[])
  3. {
  4. if(PlayerInfo[playerid][pDuty] && IsACop(playerid))
  5. {
  6. //SendClientMessageEx(playerid, COLOR_RED, "* Listing all gates within 5 meters of you...");
  7. for(new i, Float: fGatePos[3], gateid, string[128], szMessage[32]; i < MAX_GATES; i++)
  8. {
  9. if(sscanf(params, "i", gateid))
  10. GetDynamicObjectPos(GateInfo[i][gGATE], fGatePos[0], fGatePos[1], fGatePos[2]);
  11. if(IsPlayerInRangeOfPoint(playerid, 5, fGatePos[0], fGatePos[1], fGatePos[2]))
  12. {
  13. if(GateInfo[i][gModel] != 0)
  14. {
  15. format(szMessage, sizeof(szMessage), "Gate ID %d (VW: %d)", i, GateInfo[i][gVW]);
  16. SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
  17. format(string,sizeof(string),"|___________ Password Gate (ID: %d) ___________|", gateid);
  18. format(string, sizeof(string), "PassWord Gate: %s", GateInfo[i][gPass]);
  19. SendClientMessageEx(playerid, COLOR_WHITE, string);
  20.  
  21. }
  22. }
  23. }
  24. }
  25. else
  26. {
  27. SendClientMessageEx(playerid, COLOR_GRAD2, "Ban khong phai la nhan vien nha nuoc.");
  28. }
  29. return 1;
  30. }
  31.  
  32.  
  33. ------second code
  34. CMD:movegate(playerid, params[])
  35. {
  36. if(isnull(params)) return SendClientMessageEx(playerid, COLOR_GREY, "Su dung: /movegate [pass]");
  37. new Float:X, Float:Y, Float:Z;
  38. for(new i = 0; i < sizeof(GateInfo); i++)
  39. {
  40. GetDynamicObjectPos(GateInfo[i][gGATE], X, Y, Z);
  41. if (IsPlayerInRangeOfPoint(playerid,GateInfo[i][gRange], X, Y, Z))
  42. {
  43. if(strcmp(params, GateInfo[i][gPass], true) == 0)
  44. {
  45. if(GateInfo[i][gStatus] == 0)
  46. {
  47. 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]);
  48. GateInfo[i][gStatus] = 1;
  49. }
  50. else
  51. {
  52. 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]);
  53. GateInfo[i][gStatus] = 0;
  54. }
  55. }
  56. }
  57. }
  58. return 1;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement