itsDevi

Untitled

Nov 16th, 2020
108
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <a_samp>
  2.  
  3. enum jobEnum {
  4.     jobName[64],
  5.     Float:jobJoinX,
  6.     Float:jobJoinY,
  7.     Float:jobJoinZ
  8. };
  9.  
  10. new jobs[][jobEnum] = {
  11.     {"Pizza Boy",    0.0, 0.0, 0.0},
  12.     {"Miner",        0.0, 0.0, 0.0},
  13.     {"Shipment Guy", 0.0, 0.0, 0.0}
  14. };
  15.  
  16. for(new i = 0; i < sizeof(jobs); i++)
  17. {
  18.     Create3DTextLabel(jobs[i][jobName], ...);
  19. }
  20.  
  21. CMD:join(playerid, params[])
  22. {
  23.     for(new i = 0; i < sizeof(); i++)
  24.     {
  25.         SendClientMessageEx(playerid, -1, "you have joined %s", jobs[i][jobName]);
  26.     }
  27. }
  28.  
  29. #define Function::
  30.  
  31. Function::GetNearbyJob(playerid)
  32. {
  33.     for(new i = 0; i < sizeof(jobs); i++)
  34.     {
  35.         if(IsPlayerInRangeOfPoint(playerid, 1.0, jobs[i][jobJoinX], jobs[i][jobJoinY], jobs[i][jobJoinZ]))
  36.         {
  37.             return i;
  38.             break;
  39.         }
  40.     }
  41.     return -1;
  42. }
RAW Paste Data