Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // napisy
- case 1:
- {
- new index, msize, fsize, bold, fcolor, bcolor, align, font[32], text[128];
- 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]");
- 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]");
- if(strlen(text) > 50) return SendGuiInformation(playerid, "Informacja", "Zbyt długi tekst.");
- if(strlen(font) > 10) return SendGuiInformation(playerid, "Informacja", "Zbyt długi tekst czcionki.");
- if( strfind(text, ":", true) != -1 || strfind(text, "^", true) != -1 ) return SendGuiInformation(playerid, "Informacja", "Nie mozesz uzywać znaków ^ oraz :.");
- mysql_real_escape_string(font, font, mySQLconnection, 32);
- mysql_real_escape_string(text, text, mySQLconnection, 128);
- new o_id = pInfo[playerid][player_edited_object], rows, fields;
- mysql_query(mySQLconnection, sprintf("SELECT * FROM ipb_materials WHERE material_owner = %d AND material_index = %d LIMIT 1", Object[o_id][object_uid], index));
- cache_get_data(rows, fields);
- if( rows )
- {
- 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));
- }
- else
- {
- 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));
- }
Advertisement
Add Comment
Please, Sign In to add comment