13.02.2015, 04:33
Hey, I can't figure out any way to convert this to dini since I don't know anything about mysql.
I'd be happy if any the fellow scripters could help out.
I'd be happy if any the fellow scripters could help out.
Код:
forward LoadToys(playerid); public LoadToys(playerid) { //Resetting the data. printf("Loading toys for (%s)",PlayerName(playerid)); for(new i = 1; i < 5; i++) { if(i != 5) { ToyInfo[playerid][i][tID] = 0; } } //Loading the new data new rows, fields; cache_get_data(rows, fields); if(rows) { //print("Toys exist"); new fetch[255], indexid; for(new i = 0; i < rows; i++) { //printf("Toy %d loading", i); if(i < 4) { cache_get_field_content(i, "indexID", fetch); indexid = strval(fetch); ToyInfo[playerid][indexid][tID] = indexid; cache_get_field_content(i, "bone", fetch); ToyInfo[playerid][indexid][tBone] = strval(fetch); cache_get_field_content(i, "modelid", fetch); ToyInfo[playerid][indexid][tModel] = strval(fetch); cache_get_field_content(i, "OffSetX", fetch); ToyInfo[playerid][indexid][toX] = floatstr(fetch); cache_get_field_content(i, "OffSetY", fetch); ToyInfo[playerid][indexid][toY] = floatstr(fetch); cache_get_field_content(i, "OffSetZ", fetch); ToyInfo[playerid][indexid][toZ] = floatstr(fetch); cache_get_field_content(i, "RotX", fetch); ToyInfo[playerid][indexid][trX] = floatstr(fetch); cache_get_field_content(i, "RotY", fetch); ToyInfo[playerid][indexid][trY] = floatstr(fetch); cache_get_field_content(i, "RotZ", fetch); ToyInfo[playerid][indexid][trZ] = floatstr(fetch); cache_get_field_content(i, "ScaleX", fetch); ToyInfo[playerid][indexid][tsX] = floatstr(fetch); cache_get_field_content(i, "ScaleY", fetch); ToyInfo[playerid][indexid][tsY] = floatstr(fetch); cache_get_field_content(i, "ScaleZ", fetch); ToyInfo[playerid][indexid][tsZ] = floatstr(fetch); //printf("Toy %d INDEX loaded", indexid); /*if(IsValidClothing(ToyInfo[playerid][indexid][tModel])) //Create the object { SetPlayerAttachedObject(playerid, indexid, ToyInfo[playerid][indexid][tModel],ToyInfo[playerid][indexid][tBone], ToyInfo[playerid][indexid][toX], ToyInfo[playerid][indexid][toY], ToyInfo[playerid][indexid][toZ], ToyInfo[playerid][indexid][trX], ToyInfo[playerid][indexid][trY], ToyInfo[playerid][indexid][trZ], ToyInfo[playerid][indexid][tsX], ToyInfo[playerid][indexid][tsY], ToyInfo[playerid][indexid][tsZ]); } */ } } } return 1; } //============================================// forward SaveToys(playerid); public SaveToys(playerid) { new query[516]; for(new i = 1; i < 5; i++) { if(i != 5) { if(IsValidClothing(ToyInfo[playerid][i][tModel])) { format(query, sizeof(query), "UPDATE toys SET bone=%d, modelid=%d, OffSetX=%f, OffSetY=%f, OffSetZ=%f, RotX=%f, RotY=%f, RotZ=%f, ScaleX=%f, ScaleY=%f, ScaleZ=%f WHERE PlayerName='%s' AND indexID=%d", ToyInfo[playerid][i][tBone],ToyInfo[playerid][i][tModel], ToyInfo[playerid][i][toX],ToyInfo[playerid][i][toY],ToyInfo[playerid][i][toZ], ToyInfo[playerid][i][trX],ToyInfo[playerid][i][trY],ToyInfo[playerid][i][trZ], ToyInfo[playerid][i][tsX],ToyInfo[playerid][i][tsY],ToyInfo[playerid][i][tsZ], PlayerName(playerid),i); mysql_function_query(handlesql, query, false, "SendQuery", ""); } } } return 1; }