0 Stuber Posted April 1, 2018 Posted April 1, 2018 2 hours ago, Stefan said: CMD:createobj(playerid, params[]) { //if(PlayerInfo[playerid][pPin] != 0 && PinLogged[playerid] == 0) return SCM(playerid, COLOR_YELLOW, "Pentru a folosi aceasta comanda trebuie sa-ti introduci condul de securitate {FFFFFF}(/loginpin)."); if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first."); if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] >= 7) { new query[256], Float:pX,Float:pY,Float:pZ,idobj,model,string[128]; if(sscanf(params, "d", model)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFFFF}Syntaxa: /createobj <model>"); { new i = idobj+1; GetPlayerPos(playerid, pX, pY, pZ); ObjectInfo[objID] = i; ObjectInfo[objPosX] = pX; ObjectInfo[objPosY] = pY; ObjectInfo[objPosZ] = pZ; ObjectInfo[objModel] = model; mysql_format(SQL, query, sizeof(query), "UPDATE `eventobjects` SET `objPosX`='%f',`objPosY`='%f',`objPosZ`='%f',`objModel`='%d' WHERE `objID`='%d'",pX,pY,pZ,model,i); mysql_tquery(SQL,query,"",""); LoadQuest(); format(string ,sizeof(string), "Objectul cu id %d a fost creat cu succes!",model); SCM(playerid, COLOR_YELLOW, string); } } else return SendClientMessage(playerid, COLOR_ERROR, AdminOnly); } return 1;} Poza Salvare baza de date Quest: https://imgur.com/a/hVsMO Dau sa se criereze si imi apare textul ca a fost creat dar nu se pune in baza de date si nu apare nimic pe sv. Functia LoadQuest forward LoadQuest();public LoadQuest(){ questobjectss = cache_num_rows(); for(new i = 1; i <= questobjectss; i++) { new s = i - 1; ObjectInfo[objModel] = cache_get_field_content_int(s, "objModel"); ObjectInfo[objID] = cache_get_field_content_int(s, "objID"); ObjectInfo[objPosX] = cache_get_field_content_float(s, "objPosX"); ObjectInfo[objPosY] = cache_get_field_content_float(s, "objPosY"); ObjectInfo[objPosZ] = cache_get_field_content_float(s, "objPosZ"); } printf("[LOADING] %d quest objects loaded.", questobjectss);} Daca vrei sa introduci date noi in baza de date te folosesti de INSERT in nici-un caz de UPDATE, el se foloseste pentru a actualiza datele deja existente in baza de date.
0 FAStingTV Posted April 2, 2018 Posted April 2, 2018 Acum 2 ore, Stefan a spus: Vreau T/C am rezolvat , Multumesc! Cum ai facut ?am si aceiasi problema ..in loc de update ce ai pus?
0 valivaly96 Posted April 2, 2018 Posted April 2, 2018 Acum 2 ore, FAStingTV a spus: Cum ai facut ?am si aceiasi problema ..in loc de update ce ai pus? INSERT. Era greu sa citesti un pic mai sus.
Question
StefanAdv
T/C
Edited by [i]Stefan4 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now