Advertisement
Guest User

aMe and aDo - For RP Server v1.0

a guest
Aug 29th, 2012
493
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.20 KB | None | 0 0
  1. #include <a_samp>
  2. #include <sscanf2>
  3. #include <zcmd>
  4. #include <streamer>
  5.  
  6. #define COLOR_ME 0xC2A2DAFF
  7. #define COLOR_ERROR 0xFF0000FF
  8.  
  9. new Text3D:ame[MAX_PLAYERS];
  10. new Text3D:ado[MAX_PLAYERS];
  11. new amestatus[MAX_PLAYERS], adostatus[MAX_PLAYERS];
  12.  
  13. public OnFilterScriptInit()
  14. {
  15.     print("\n-----------------------------------------------");
  16.     print(" AME and ADO Filterscript by IceMeteor - Ravian ");
  17.     print("-----------------------------------------------\n");
  18.     return 1;
  19. }
  20.  
  21. public OnFilterScriptExit()
  22. {
  23.     return 1;
  24. }
  25.  
  26. public OnPlayerDisconnect(playerid, reason)
  27. {
  28.     DestroyDynamic3DTextLabel(ado[playerid]);
  29.     DestroyDynamic3DTextLabel(ame[playerid]);
  30.     amestatus[playerid] = 0;
  31.     adostatus[playerid] = 0;
  32.     return 1;
  33. }
  34.  
  35. GetRPName(playerid)
  36. {
  37.     new RPName[MAX_PLAYER_NAME], i_pos;
  38.     GetPlayerName(playerid, RPName, MAX_PLAYER_NAME);
  39.     while ((i_pos = strfind(RPName, "_", false, i_pos)) != -1) RPName[i_pos] = ' ';
  40.     return RPName;
  41. }
  42.  
  43. CMD:ame(playerid, params[])
  44. {
  45.     new result[100], string[140];
  46.     if(sscanf(params, "s[100]", result))
  47.     {
  48.         SendClientMessage(playerid, COLOR_ERROR, "USAGE:{FFFFFF} /ame [description] - This text will show up above your head.");
  49.         SendClientMessage(playerid, COLOR_ERROR, "HINT:{FFFFFF} Use (/ame off) to remove the text!");
  50.         return 1;
  51.     }
  52.     if(strlen(result) >100) return SendClientMessage(playerid, COLOR_ERROR, "The description shouldn't more than 100 character!");
  53.     if(strcmp(result, "off", true) == 0)
  54.     {
  55.         if(amestatus[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "You don't have any ame attached!");
  56.         DestroyDynamic3DTextLabel(ame[playerid]);
  57.         SendClientMessage(playerid, COLOR_ME, "AME deleted!");
  58.         amestatus[playerid] = 0;
  59.         return 1;
  60.     }
  61.     if(amestatus[playerid] == 0)
  62.     {
  63.         format(string, sizeof(string), "* %s %s *", GetRPName(playerid), result);
  64.         ame[playerid] = CreateDynamic3DTextLabel(string, COLOR_ME, 0.0, 0.0, 0.0, 40.0, playerid);
  65.         format(string, sizeof(string), "AME >> %s", string);
  66.         SendClientMessage(playerid, COLOR_ME, "You have attached an AME above your head!");
  67.         SendClientMessage(playerid, COLOR_ME, string);
  68.         amestatus[playerid] = 1;
  69.     }
  70.     else
  71.     {
  72.         format(string, sizeof(string), "* %s %s *", GetRPName(playerid), result);
  73.         UpdateDynamic3DTextLabelText(ame[playerid], COLOR_ME, string);
  74.         format(string, sizeof(string), "AME Update Success! >> %s", string);
  75.         SendClientMessage(playerid, COLOR_ME, string);
  76.         return 1;
  77.     }
  78.     return 1;
  79. }
  80.  
  81. CMD:ado(playerid, params[])
  82. {
  83.     new result[100], string[140];
  84.     if(sscanf(params, "s[200]", result))
  85.     {
  86.         SendClientMessage(playerid, COLOR_ERROR, "USAGE:{FFFFFF} /ado [description] - This text will stay on your current place.");
  87.         SendClientMessage(playerid, COLOR_ERROR, "HINT:{FFFFFF} Use (/ado off) to remove the text!");
  88.         return 1;
  89.     }
  90.     if(strlen(result) >100) return SendClientMessage(playerid, COLOR_ERROR, "The description shouldn't more than 100 character!");
  91.     if(strcmp(result, "off", true) == 0)
  92.     {
  93.         if(adostatus[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "You don't have any ado attached!");
  94.         DestroyDynamic3DTextLabel(ado[playerid]);
  95.         SendClientMessage(playerid, COLOR_ME, "ADO deleted!");
  96.         adostatus[playerid] = 0;
  97.         return 1;
  98.     }
  99.     if(adostatus[playerid] == 0)
  100.     {
  101.         new Float:AdoX, Float:AdoY, Float:AdoZ;
  102.         GetPlayerPos(playerid, AdoX, AdoY, AdoZ);
  103.         format(string, sizeof(string), "* %s *\n(( %s ))", result, GetRPName(playerid));
  104.         ado[playerid] = CreateDynamic3DTextLabel(string, COLOR_ME, AdoX, AdoY, AdoZ, 40.0);
  105.         SendClientMessage(playerid, COLOR_ME, "You have attached an ADO at your current place!");
  106.         adostatus[playerid] = 1;
  107.     }
  108.     else
  109.     {
  110.         format(string, sizeof(string), "* %s *\n(( %s ))", result, GetRPName(playerid));
  111.         UpdateDynamic3DTextLabelText(ado[playerid], COLOR_ME, string);
  112.         SendClientMessage(playerid, COLOR_ME, "ADO Update Success!");
  113.         return 1;
  114.     }
  115.     return 1;
  116. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement