Jump to content
  • 0

pomoc Techničák


Stellet

Dotaz

Ahoj, chtěl jsem si udělat techničák, jenže něják se mi nedaří..
Prostě mám: 
CMD:technicak(playerid, params[])
{
    SCM(playerid, -1, "Techničák:");
    new str[200], jmeno[25];
    GetPlayerName(playerid, jmeno, sizeof(jmeno));

    for(new i; i<sizeof(Vozidlo); i++)
    {
		if(!strcmp(Vozidlo[i][majitel], jmeno, true))
 		{
       		format(str, sizeof(str), "\n - %s | %s", GetVehicleName(Vozidlo[i][model]), Vozidlo[i][spz]);
           	SCM(playerid,-1,str);
           	return 1;
  		}
    }
    return 1;
}

No, kdyže mám pod SCM return 1; tak mi to tam hodí jedno auto a pak třeba 50x: - |

A když tam dám return 1; tak mi zase najde jen jedno moje auto..

 

Link to comment
Share on other sites

9 odpovědí na tuto otázku

Recommended Posts

  • 0

return vyhod ale pokud porovnavas s null stringem vzdy ti to vyhodi ze se shoduji

if(Vozidlo[i][majitel][0] != 0 && !strcmp(Vozidlo[i][majitel], jmeno, true))
Link to comment
Share on other sites

  • 0

 

return vyhod ale pokud porovnavas s null stringem vzdy ti to vyhodi ze se shoduji

if(Vozidlo[i][majitel][0] != 0 && !strcmp(Vozidlo[i][majitel], jmeno, true))

Teď to neukáže vůbec nic, jen: Techničák: a nic víc.

Link to comment
Share on other sites

  • 0
CMD:technicak(playerid,params[])
{
    SCM(playerid,-1,"Techničák:");
    new str[144],jmeno[MAX_PLAYER_NAME];
    GetPlayerName(playerid,jmeno,sizeof(jmeno));
    for(new i; i<sizeof(Vozidlo); i++)
    {
        printf("%s == %s",Vozidlo[i][majitel],jmeno);
		if(Vozidlo[i][majitel][0] != 0 && !strcmp(Vozidlo[i][majitel],jmeno,true))
 		{
       		format(str,sizeof(str),"\n - %s | %s",GetVehicleName(Vozidlo[i][model]),Vozidlo[i][spz]);
           	SCM(playerid,-1,str);
           	print(str);
  		}
    }
    return 1;
}

Pouzij toto a pak nam ukaz server log

  • Líbí se mi to! (+1) 1
Link to comment
Share on other sites

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