KaLu17

Untitled

Mar 22nd, 2017
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // napisy
  2. case 1:
  3. {
  4. new index, msize, fsize, bold, fcolor, bcolor, align, font[32], text[128];
  5. if( sscanf(param, "ddddxxds[32]s[128]", index, msize, fsize, bold, fcolor, bcolor, align, font, text) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /mmat 1 [index (0-15)] [Matsize (10-140) [Fontsize (24-255)] [Bold] [Fontcol] [Backcol] [Align (0-2)] [Font] [Txt]");
  6. if( index < 0 || index > 15 ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /mmat 1 [index (0-15)] [Matsize (10-140) [Fontsize (24-255)] [Bold] [Fontcol] [Backcol] [Align (0-2)] [Font] [Txt]");
  7. if(strlen(text) > 50) return SendGuiInformation(playerid, "Informacja", "Zbyt długi tekst.");
  8. if(strlen(font) > 10) return SendGuiInformation(playerid, "Informacja", "Zbyt długi tekst czcionki.");
  9. if( strfind(text, ":", true) != -1 || strfind(text, "^", true) != -1 ) return SendGuiInformation(playerid, "Informacja", "Nie mozesz uzywać znaków ^ oraz :.");
  10.  
  11. mysql_real_escape_string(font, font, mySQLconnection, 32);
  12. mysql_real_escape_string(text, text, mySQLconnection, 128);
  13.  
  14. new o_id = pInfo[playerid][player_edited_object], rows, fields;
  15.  
  16. mysql_query(mySQLconnection, sprintf("SELECT * FROM ipb_materials WHERE material_owner = %d AND material_index = %d LIMIT 1", Object[o_id][object_uid], index));
  17. cache_get_data(rows, fields);
  18.  
  19. if( rows )
  20. {
  21. mysql_query(mySQLconnection, sprintf("UPDATE ipb_materials SET material_texture = '1^%d:%d:%d:%d:%06x:%06x:%d:%s:%s' WHERE material_owner = %d AND material_index = %d", index, msize, fsize, bold, fcolor, bcolor, align, font, text, Object[o_id][object_uid], index));
  22. }
  23. else
  24. {
  25. mysql_query(mySQLconnection, sprintf("INSERT INTO ipb_materials SET material_texture = '1^%d:%d:%d:%d:%06x:%06x:%d:%s:%s', material_owner = %d, material_index = %d",index, msize, fsize, bold, fcolor, bcolor, align, font, text, Object[o_id][object_uid], index));
  26. }
Advertisement
Add Comment
Please, Sign In to add comment