strcat problem [+4rep]
#1

Hello, problem warning

Код:
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(14 -- 15) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(14 -- 15) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(14 -- 15) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(14 -- 15) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(14 -- 15) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(17 -- 18) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(17 -- 18) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(17 -- 18) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(17 -- 18) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(17 -- 18) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(20) : warning 213: tag mismatch
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(20 -- 21) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(20 -- 21) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(20 -- 21) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(20 -- 21) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(20 -- 21) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(23 -- 24) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(23 -- 24) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(23 -- 24) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(23 -- 24) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(23 -- 24) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(26 -- 27) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(26 -- 27) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(26 -- 27) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(26 -- 27) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(26 -- 27) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(26 -- 27) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(29 -- 30) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(29 -- 30) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(29 -- 30) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(29 -- 30) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(29 -- 30) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(32 -- 33) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(32 -- 33) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(32 -- 33) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(32 -- 33) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(32 -- 33) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(35 -- 36) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(35 -- 36) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(35 -- 36) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(35 -- 36) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(35 -- 36) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(38 -- 39) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(38 -- 39) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(38 -- 39) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(38 -- 39) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(38 -- 39) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(38 -- 39) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(38 -- 39) : warning 202: number of arguments does not match definition
C:\Users\Miguel\Documents\GTA San Andreas User Files\Pawn\Night Life\pawno\include\NLRP\InitCompte.inc(38 -- 39) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


50 Warnings.
Код:
public SaveAccount(playerid)
{
        new string[1024];
	strcat(string, "UPDATE comptes SET p_mdp = %s, p_email = %s, p_code = %d, p_ip = %s, p_warn = %d, p_jail = %d",p_info[playerid][p_mdp],
	p_info[playerid][p_email],p_info[playerid][p_code],p_info[playerid][p_ip],p_info[playerid][p_warn],p_info[playerid][p_jail]);
	
	strcat(string, "p_ban = %d, p_skin = %d, p_age = %d, p_origine = %d, p_telephone",p_info[playerid][p_ban],
	p_info[playerid][p_ban],p_info[playerid][p_skin],p_info[playerid][p_age],p_info[playerid][p_origine],p_info[playerid][p_telephone]);

	strcat(string, "p_credits = %f, p_admin = %d, p_vip = %d, p_sac = %d, p_weed = %d, p_canabis = %d",p_info[playerid][p_credits],
	p_info[playerid][p_admin],p_info[playerid][p_vip],p_info[playerid][p_sac],p_info[playerid][p_weed],p_info[playerid][p_canabis]);
	
	strcat(string, "p_graine = %d, p_arme1 = %d, p_arme2 = %d, p_arme_vip1 = %d, p_arme_vip2 = %d, p_arme_vip3 = %d",p_info[playerid][p_graine],
	p_info[playerid][p_arme1],p_info[playerid][p_arme2],p_info[playerid][p_arme_vip1],p_info[playerid][p_arme_vip2],p_info[playerid][p_arme_vip3]);
	
	strcat(string, "p_faction = %d, p_rang = %d, p_maison = %d, p_commerce = %d, p_crash_x = %f, p_crash_y = %f, p_crash_z = %f",p_info[playerid][p_faction],
	p_info[playerid][p_rang],p_info[playerid][p_maison],p_info[playerid][p_commerce],p_info[playerid][p_crash_x],p_info[playerid][p_crash_y],p_info[playerid][p_crash_z]);
	
	strcat(string, "p_crash_int = %d, p_crash_wv = %d, p_rename = %d, p_annuaire = %d, p_baillon = %d, p_jerrican = %d",p_info[playerid][p_crash_int],
	p_info[playerid][p_crash_wv],p_info[playerid][p_rename],p_info[playerid][p_annuaire],p_info[playerid][p_baillon],p_info[playerid][p_jerrican]);
	
	strcat(string, "p_permis_moto = %d, p_permis_pmoto = %d, p_permis_avion = %d, p_permis_car = %d, p_permis_pcar = %d, p_permis_arme",p_info[playerid][p_permis_moto],
	p_info[playerid][p_permis_pmoto],p_info[playerid][p_permis_avion],p_info[playerid][p_permis_car],p_info[playerid][p_permis_pcar],p_info[playerid][p_permis_arme]);
	
	strcat(string, "p_temps_travaille = %d, p_tuto = %d, p_casquette = %d, p_bandana = %d, p_lunette = %d, p_sante = %d",p_info[playerid][p_temps_travaille],
	p_info[playerid][p_tuto],p_info[playerid][p_casquette],p_info[playerid][p_bandana],p_info[playerid][p_lunette],p_info[playerid][p_sante]);
	
	strcat(string, "p_armure = %d, p_cagoule = %d, p_cigarettes = %d, p_tabac = %d, p_feuilles = %d, p_combat = %d, p_marche = %d, p_compte = %d WHERE p_id = %d",p_info[playerid][p_armure],
	p_info[playerid][p_cagoule],p_info[playerid][p_cigarettes],p_info[playerid][p_tabac],p_info[playerid][p_feuilles],p_info[playerid][p_combat],p_info[playerid][p_marche],p_info[playerid][p_compte],p_info[playerid][p_id]);
	mysql_function_query(mysql, string, true, "", "");
	return 1;
}
Thank (my bad english sorry)
Reply
#2

strcat is not used as format. You should format the string first and then if you want to join the formatted string to another string, you can use strcat. However, format can be used to insert the previous string too.
Reply
#3

Please read the article on the wiki on how to use strcat properly:
https://sampwiki.blast.hk/wiki/Strcat
Reply
#4

pawn Код:
public SaveAccount(playerid)
{
    new string[1024], string1[1024];
    format(string1, sizeof(string1), "UPDATE comptes SET p_mdp = %s, p_email = %s, p_code = %d, p_ip = %s, p_warn = %d, p_jail = %d",p_info[playerid][p_mdp],
    p_info[playerid][p_email],p_info[playerid][p_code],p_info[playerid][p_ip],p_info[playerid][p_warn],p_info[playerid][p_jail]);
    strcat(string, string1);

    format(string1, sizeof(string1), "p_ban = %d, p_skin = %d, p_age = %d, p_origine = %d, p_telephone",p_info[playerid][p_ban],
    p_info[playerid][p_ban],p_info[playerid][p_skin],p_info[playerid][p_age],p_info[playerid][p_origine],p_info[playerid][p_telephone]);
    strcat(string, string1);

    format(string1, sizeof(string1), "p_credits = %f, p_admin = %d, p_vip = %d, p_sac = %d, p_weed = %d, p_canabis = %d",p_info[playerid][p_credits],
    p_info[playerid][p_admin],p_info[playerid][p_vip],p_info[playerid][p_sac],p_info[playerid][p_weed],p_info[playerid][p_canabis]);
    strcat(string, string1);

    format(string1, sizeof(string1), "p_graine = %d, p_arme1 = %d, p_arme2 = %d, p_arme_vip1 = %d, p_arme_vip2 = %d, p_arme_vip3 = %d",p_info[playerid][p_graine],
    p_info[playerid][p_arme1],p_info[playerid][p_arme2],p_info[playerid][p_arme_vip1],p_info[playerid][p_arme_vip2],p_info[playerid][p_arme_vip3]);
    strcat(string, string1);

    format(string1, sizeof(string1), "p_faction = %d, p_rang = %d, p_maison = %d, p_commerce = %d, p_crash_x = %f, p_crash_y = %f, p_crash_z = %f",p_info[playerid][p_faction],
    p_info[playerid][p_rang],p_info[playerid][p_maison],p_info[playerid][p_commerce],p_info[playerid][p_crash_x],p_info[playerid][p_crash_y],p_info[playerid][p_crash_z]);
    strcat(string, string1);

    format(string, sizeof(string1), "p_crash_int = %d, p_crash_wv = %d, p_rename = %d, p_annuaire = %d, p_baillon = %d, p_jerrican = %d",p_info[playerid][p_crash_int],
    p_info[playerid][p_crash_wv],p_info[playerid][p_rename],p_info[playerid][p_annuaire],p_info[playerid][p_baillon],p_info[playerid][p_jerrican]);
    strcat(string, string1);

    format(string, sizeof(string1), "p_permis_moto = %d, p_permis_pmoto = %d, p_permis_avion = %d, p_permis_car = %d, p_permis_pcar = %d, p_permis_arme",p_info[playerid][p_permis_moto],
    p_info[playerid][p_permis_pmoto],p_info[playerid][p_permis_avion],p_info[playerid][p_permis_car],p_info[playerid][p_permis_pcar],p_info[playerid][p_permis_arme]);
    strcat(string, string1);

    format(string, sizeof(string1), "p_temps_travaille = %d, p_tuto = %d, p_casquette = %d, p_bandana = %d, p_lunette = %d, p_sante = %d",p_info[playerid][p_temps_travaille],
    p_info[playerid][p_tuto],p_info[playerid][p_casquette],p_info[playerid][p_bandana],p_info[playerid][p_lunette],p_info[playerid][p_sante]);
    strcat(string, string1);

    format(string, sizeof(string1), "p_armure = %d, p_cagoule = %d, p_cigarettes = %d, p_tabac = %d, p_feuilles = %d, p_combat = %d, p_marche = %d, p_compte = %d WHERE p_id = %d",p_info[playerid][p_armure],
    p_info[playerid][p_cagoule],p_info[playerid][p_cigarettes],p_info[playerid][p_tabac],p_info[playerid][p_feuilles],p_info[playerid][p_combat],p_info[playerid][p_marche],p_info[playerid][p_compte],p_info[playerid][p_id]);
    strcat(string, string1);
   
    mysql_function_query(mysql, string, true, "", "");
    return 1;
}
Reply
#5

Yes, +4 to RenSoprano, Macronix, Konstatiano
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)