Jump to content
  • 0

Sprijin quest Tiki.


catalin9325

Question

Problema intalnita (descriere): Nu mi se salveaza pTiki , pTikix in baza de date . 
Ero(area / rile) / warning-(ul / urile): Dau relog , si pot sa il iau pe acelasi din nou.
Liniile de cod / sursa / script-ul(obligatoriu): MYsql - Tiki
Imagini / Video (optional):-
Ati incercat sa rezolvati singur?: Da , dar tot nu se salveaza , va multumesc !

Link to comment
Share on other sites

19 answers to this question

Recommended Posts

  • 0

Urmeaza sa faci asa:

Cand intra in tiki #2 - sa ii arate mesajul iar mysql sa salveze:

mysql_format(conn, str, sizeof(str), "UPDATE * FROM `tiki_quest` WHERE `Name`='%e' AND TIKI='%d' ", pTikix);

mysql_query(conn, str);

Sper ca ai inteles !

Link to comment
Share on other sites

  • 0
Acum 13 minute, [PAWN]Stark.7 a spus:

Urmeaza sa faci asa:

Cand intra in tiki #2 - sa ii arate mesajul iar mysql sa salveze:


mysql_format(conn, str, sizeof(str), "UPDATE * FROM `tiki_quest` WHERE `Name`='%e' AND TIKI='%d' ", pTikix);

mysql_query(conn, str);

Sper ca ai inteles !

am facut asa , tot nu merge..

Link to comment
Share on other sites

  • 0

Uite un mic exemplu, nu sunt sigur ca este si functionabil.

new pickup_tiki[25];
#define pTikix1 0
#define pTikix2 1
#define pTikix3 2
#define pTikix4 3
#define pTikix5 4
#define pTikix6 5
#define pTikix7 6
#define pTikix8 7
#define pTikix9 8
#define pTikix10 9
#define pTikix11 10
#define pTikix12 11
// [...]

public OnGameModeInit()
{
    pickup_tiki[0] = CreatePickup(1274, 2, 0.0, 0.0, 9.0); // Tiki #1
		pickup_tiki[1] = CreatePickup(1274, 2, 0.0, 0.0, 9.0); // Tiki #2
		pickup_tiki[2] = CreatePickup(1274, 2, 0.0, 0.0, 9.0); // Tiki #3
		pickup_tiki[3] = CreatePickup(1274, 2, 0.0, 0.0, 9.0); // Tiki #4
		pickup_tiki[4] = CreatePickup(1274, 2, 0.0, 0.0, 9.0); // Tiki #5
		pickup_tiki[5] = CreatePickup(1274, 2, 0.0, 0.0, 9.0); // Tiki #6
    return 1;
}
 
forward UpdateTiki(playerid, type);
public UpdateTiki(playerid, type) {
	switch(type)
	{
		case pTikix1: // Tiki #1 
		{
			new str[128];
			mysql_format(cHandle, str, sizeof(str), "UPDATE * FROM `tiki_quest` WHERE `Name` = '%e' AND `TikiID` = '%d'", playerid, pTikix1);
			mysql_query(cHandle, str);
		}
		
		case pTikix2: // Tiki #2 
		{
			new str[128];
			mysql_format(cHandle, str, sizeof(str), "UPDATE * FROM `tiki_quest` WHERE `Name` = '%e' AND `TikiID` = '%d'", playerid, pTikix1);
			mysql_query(cHandle, str);
		}
	}
}
 
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == pickup_tiki[0])
    {
      SendClientMessage(playerid, -1, "[QUEST]: Ai gasit o statuit Tiki (1/25).");
			UpdateTiki(playerid, pTikix1);
    }
    else if(pickupid == pickup_tiki[1])
    {
      SendClientMessage(playerid, -1, "[QUEST]: Ai gasit o statuit Tiki (2/25).");
			UpdateTiki(playerid, pTikix2);
    }
    else if(pickupid == pickup_tiki[2])
    {
      SendClientMessage(playerid, -1, "[QUEST]: Ai gasit o statuit Tiki (3/25).");
			UpdateTiki(playerid, pTikix3);
    }
    else if(pickupid == pickup_tiki[3])
    {
      SendClientMessage(playerid, -1, "[QUEST]: Ai gasit o statuit Tiki (4/25).");
			UpdateTiki(playerid, pTikix4);
    }
    return 1;
}

 

Link to comment
Share on other sites

  • 0
Acum 1 minut, [PAWN]Stark.7 a spus:

Uite un mic exemplu, nu sunt sigur ca este si functionabil.


new pickup_tiki[25];
#define pTikix1 0
#define pTikix2 1
#define pTikix3 2
#define pTikix4 3
#define pTikix5 4
#define pTikix6 5
#define pTikix7 6
#define pTikix8 7
#define pTikix9 8
#define pTikix10 9
#define pTikix11 10
#define pTikix12 11
// [...]

public OnGameModeInit()
{
    pickup_tiki[0] = CreatePickup(1274, 2, 0.0, 0.0, 9.0); // Tiki #1
		pickup_tiki[1] = CreatePickup(1274, 2, 0.0, 0.0, 9.0); // Tiki #2
		pickup_tiki[2] = CreatePickup(1274, 2, 0.0, 0.0, 9.0); // Tiki #3
		pickup_tiki[3] = CreatePickup(1274, 2, 0.0, 0.0, 9.0); // Tiki #4
		pickup_tiki[4] = CreatePickup(1274, 2, 0.0, 0.0, 9.0); // Tiki #5
		pickup_tiki[5] = CreatePickup(1274, 2, 0.0, 0.0, 9.0); // Tiki #6
    return 1;
}
 
forward UpdateTiki(playerid, type);
public UpdateTiki(playerid, type) {
	switch(type)
	{
		case pTikix1: // Tiki #1 
		{
			new str[128];
			mysql_format(cHandle, str, sizeof(str), "UPDATE * FROM `tiki_quest` WHERE `Name` = '%e' AND `TikiID` = '%d'", playerid, pTikix1);
			mysql_query(cHandle, str);
		}
		
		case pTikix2: // Tiki #2 
		{
			new str[128];
			mysql_format(cHandle, str, sizeof(str), "UPDATE * FROM `tiki_quest` WHERE `Name` = '%e' AND `TikiID` = '%d'", playerid, pTikix1);
			mysql_query(cHandle, str);
		}
	}
}
 
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == pickup_tiki[0])
    {
      SendClientMessage(playerid, -1, "[QUEST]: Ai gasit o statuit Tiki (1/25).");
			UpdateTiki(playerid, pTikix1);
    }
    else if(pickupid == pickup_tiki[1])
    {
      SendClientMessage(playerid, -1, "[QUEST]: Ai gasit o statuit Tiki (2/25).");
			UpdateTiki(playerid, pTikix2);
    }
    else if(pickupid == pickup_tiki[2])
    {
      SendClientMessage(playerid, -1, "[QUEST]: Ai gasit o statuit Tiki (3/25).");
			UpdateTiki(playerid, pTikix3);
    }
    else if(pickupid == pickup_tiki[3])
    {
      SendClientMessage(playerid, -1, "[QUEST]: Ai gasit o statuit Tiki (4/25).");
			UpdateTiki(playerid, pTikix4);
    }
    return 1;
}

 

fix la fel am si eu :))

Ce sa fac sa se salveze in sql ? ...

  • Upvote 1
Link to comment
Share on other sites

  • 0

Posteaza aici cum ai definita conexiunea cu baza de date, nu ma intreseaza parola sau alte detalii !

Trebuie sa ai ceva de genul:

cHandle = mysql_connect("host", "user", "db", "pass");, sql = mysql_connect("host", "user", "db", "pass");

 

Link to comment
Share on other sites

  • 0

Uite ceva de genul trebuie sa ai tu un tabel:

CREATE TABLE `tabel_tau`.`tiki`
(`PlayerName` VARCHAR(32) NOT NULL,
`Tiki1` INT(11) NULL DEFAULT '-1',
`Tiki2` INT(11) NOT NULL DEFAULT '-1',
`Tiki3` INT(11) NOT NULL DEFAULT '-1',
`Tiki4` INT(11) NOT NULL DEFAULT '-1',
`Tiki5` INT(11) NOT NULL DEFAULT '-1',
`Tiki6` INT(11) NOT NULL DEFAULT '-1',
`Tiki7` INT(11) NOT NULL DEFAULT '-1',
`Tiki8` INT(11) NOT NULL DEFAULT '-1',
`Tiki9` INT(11) NOT NULL DEFAULT '-1',
`Tiki10` INT(11) NOT NULL DEFAULT '-1'
) ENGINE = InnoDB;

 

Link to comment
Share on other sites

  • 0

Tu ai asa

case pTikix1: // Tiki #1 
		{
			new str[128];
			mysql_format(cHandle, str, sizeof(str), "UPDATE * FROM `tiki_quest` WHERE `Name` = '%e' AND `TikiID` = '%d'", playerid, pTikix1);
			mysql_query(cHandle, str);
		}
		

 

 

trebuie sa ai ma gandesc in loc de playerid sa ai numele

adica 

case pTikix1: // Tiki #1 
		{
			new str[128],named[4];
			GetPlayerName(playerid,named,sizeof(named));
			mysql_format(cHandle, str, sizeof(str), "UPDATE * FROM `tiki_quest` WHERE `Name` = '%e' AND `TikiID` = '%d'", named, pTikix1);
			mysql_query(cHandle, str);
		}
		

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

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. For more details you can also review our Terms of Use and Privacy Policy.