Jump to content

tag mismatch


mateiualex
 Share

Recommended Posts

Unde e acea idioată eroare? :)) mi-a dat batai de cap 30 minute. 

CMD:setskin(playerid,params[])
{
    if(PlayerInfo[playerid][Admin] < 3)
{
new id, string[256], giveplayer[25],skin;
if(sscanf(params, "ui", id,skin)) return SendClientMessage(playerid, -1,"/setskin [playerid] [skin id]");
{
if(id != INVALID_PLAYER_ID)
       {
if(skin < 300 && skin >= 0)
{
GetPlayerName(id, giveplayer, sizeof(giveplayer)); 
format(string, sizeof(string), "You set %s's skin to %d.", giveplayer, skin);
SendClientMessage(playerid, COLOR_WHITE, string);
PlayerInfo[id][Skin] = skin;
SetPlayerSkin(id, skin);
new wakaname[25];
GetPlayerName(id,wakaname,25);
new str[128];
format(str,128,"UPDATE `accounts` SET `Skin`='%d' WHERE `playerID`='%d'",Float:skin,PlayerInfo[id][pInternalID]); //AICI ZICE CA E EROARE
mysql_tquery(handle,str);
}
}
}
}
else return SendClientMessage(playerid, COLOR_WHITE, AdminOnly);
return 1;
}
Edited by Netistul
Link to comment
Share on other sites

format(str, 256,"UPDATE `accounts` SET `Skin`='%d' WHERE `playerID`='%d'",PlayerInfo[id][skin], [id][pInternalID]);
mysql_query(handle,str);

Daca vrei:

mysql_format(handle, str, sizeof(str), "UPDATE accounts SET Skin = "%d" WHERE playerID = "%d", PlayerInfo[id][skin],  PlayerInfo[id][pInternalID]); 

Link to comment
Share on other sites

format(str, 256,"UPDATE `accounts` SET `Skin`='%d' WHERE `playerID`='%d'",PlayerInfo[id][skin], [id][pInternalID]);

mysql_query(handle,str);

Daca vrei:

mysql_format(handle, str, sizeof(str), "UPDATE accounts SET Skin = "%d" WHERE playerID = "%d", PlayerInfo[id][skin],  PlayerInfo[id][pInternalID]); 

 

 

 

Asa, ce zici?

new Str[256];

     mysql_format(handle, Str, sizeof(Str, "aici pui tu ce ai dupa");
     mysql_query(handle ,Str);
    }

   }

  }

 

În continuare nu se salvează skin-urile în database, habar nu am ce pot face :))

Link to comment
Share on other sites

Poti prezenta functia INSERT INTO accounts?

mysql_format(mysql, query, sizeof(query), "INSERT INTO `accounts` (`Name`, `Password`, `IP`, `Admin`, `VIP`, `Money`, `PosX`, `PosY`, `PosZ`, `PosA`,`Skin`) VALUES ('%e', '%e', '%e', 0, 0, 0, %f, %f, %f, %f,0)", playername, PlayerInfo[playerid][Password], playerip, SPAWN_X, SPAWN_Y, SPAWN_Z, SPAWN_A);
            mysql_tquery(mysql, query, "OnAccountRegister", "i", playerid);

 

La Update sau savePlayerData ai macar functia de-a salva skin-uriile? playerSkin aia?

Momentan nu am aceste functii, am setat să salveze la login / disconnect cum e mai sus, nu e corect? :D
Edited by Netistul
Link to comment
Share on other sites

Incearca comanda asta:

CMD:setskin(playerid, params[]) {
	new skin, target, string[128], query[256];
	//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 	if(PlayerInfo[playerid][Admin] < 3) return SendClientMessage(playerid, 0xFF0000FF, "Nu ai nivelul corespunzator!");
	else {
	    if(sscanf(params,"ud", target, skin)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /SetSkin [playerid][skinid]!");
        //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
		if(!IsPlayerConnected(target)) return SendClientMessage(playerid, 0xFF0000FF, "Jucator neconectat!");
        //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
		if(skin < 0 && skin > 300) return SendClientMessage(playerid, 0xFF0000FF, "-1<SkinID<300!");
	    PlayerInfo[target][Skin] = skin, SetPlayerSkin(target, skin);
        //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
		format(string, sizeof(string), "Ai schimbat skinul playerului %s!", GetName(target));
	    SendClientMessage(playerid, -1, string);
        //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
		mysql_format(mysql, query, sizeof(query), "UPDATE accounts SET Skin = '%d' WHERE playerID = '%d'", skin, target);
		mysql_query(mysql, query); }
	//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
		return 1;
} 

Daca nu ai getname 

GetName(playerid) {
	new name[MAX_PLAYER_NAME];
	//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	GetPlayerName(playerid, name, sizeof(name));
	//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	return name; } 
Link to comment
Share on other sites

 

Incearca comanda asta:

CMD:setskin(playerid, params[]) {
	new skin, target, string[128], query[256];
	//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 	if(PlayerInfo[playerid][Admin] < 3) return SendClientMessage(playerid, 0xFF0000FF, "Nu ai nivelul corespunzator!");
	else {
	    if(sscanf(params,"ud", target, skin)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /SetSkin [playerid][skinid]!");
        //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
		if(!IsPlayerConnected(target)) return SendClientMessage(playerid, 0xFF0000FF, "Jucator neconectat!");
        //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
		if(skin < 0 && skin > 300) return SendClientMessage(playerid, 0xFF0000FF, "-1<SkinID<300!");
	    PlayerInfo[target][Skin] = skin, SetPlayerSkin(target, skin);
        //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
		format(string, sizeof(string), "Ai schimbat skinul playerului %s!", GetName(target));
	    SendClientMessage(playerid, -1, string);
        //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
		mysql_format(mysql, query, sizeof(query), "UPDATE accounts SET Skin = '%d' WHERE playerID = '%d'", skin, target);
		mysql_query(mysql, query); }
	//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
		return 1;
} 

Daca nu ai getname 

GetName(playerid) {
	new name[MAX_PLAYER_NAME];
	//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	GetPlayerName(playerid, name, sizeof(name));
	//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	return name; } 

Tot nu salvează skin, la mine problema este sigur undeva la trimiterea informatiilor catre database, nu cred ca am o functie care sa faca asta intr-un timp de refresh mic.

Link to comment
Share on other sites

Incearca asa, stiu ca e cam aceeasi chestie pe care o ai tu acolo, faci o "chestie" suplimentara,

forward Update(playerid, type);
 
public Update(playerid, type)
{
if(IsPlayerConnected(playerid))
{
new var[356];
{
switch(type)
{

case pSkin:
{
mysql_format(handle, var, sizeof(var), "UPDATE `playeraccounts` SET `playerSkin`='%d' WHERE `playerID`='%d'",playerVariables[playerid][pSkin], playerVariables[playerid][pInternalID]);
mysql_tquery(handle,var,"","");
}
}
}
}

Iar la comanda ta adaugi asta

 

Update(id, pSkin);
Edited by ZoroN
  • Upvote 1
Link to comment
Share on other sites

Ia vezi, asa: Dati /setskin dai /savedata si dai rr se salveaza?

 

 

 

Incearca asa, stiu ca e cam aceeasi chestie pe care o ai tu acolo, faci o "chestie" suplimentara,

forward Update(playerid, type);
 
public Update(playerid, type)
{
if(IsPlayerConnected(playerid))
{
new var[356];
{
switch(type)
{

case pSkin:
{
mysql_format(handle, var, sizeof(var), "UPDATE `playeraccounts` SET `playerSkin`='%d' WHERE `playerID`='%d'",playerVariables[playerid][pSkin], playerVariables[playerid][pInternalID]);
mysql_tquery(handle,var,"","");
}
}
}
}

Iar la comanda ta adaugi asta

Update(id, pSkin);

Mersi de ajutor băieți, am reusit ceva ceva, oricum amân nițel proiectul până în vacanta dintre semestre. Ce-mi place aici e că mereu sunt unii care îți sar în ajutor și cu fiecare experiență parcă înțelegi mai bine limbajul de programare PAWNO.

:wub:

.t/c.

Link to comment
Share on other sites

Mersi de ajutor băieți, am reusit ceva ceva, oricum amân nițel proiectul până în vacanta dintre semestre. Ce-mi place aici e că mereu sunt unii care îți sar în ajutor și cu fiecare experiență parcă înțelegi mai bine limbajul de programare PAWNO.

:wub:

.t/c.

ZoroN e RRom

Glm, e frtlm. Ti-am spus ca nu ai alea salvate, el ti-a dat linia sa se salveze in baza, succes cu proiectul ;)

  • Upvote 2
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.