Jump to content

Question

Posted

Pai problema este, daca dau /v imi zice ca nu am masina personala, asta se intampla dupa relog sau inainte de relog, dupa relog orice ar fi apare acel text.

comada:

CMD:v(playerid, params[])
{
	if(GetVehNumber(playerid) == 0)
	{
		return SCM(playerid, COLOR_SERVER, "EROARE: Nu ai masina personala.");
	}
	else
	{
		new var[512], szTitle[256];
		format(szTitle, sizeof(szTitle), "Garajul lui %s (%d sloturi)", GetName(playerid), PlayerData[playerid][pVehKeys]);
		for(new i = 1; i <= Total_Veh_Created; i++)
		{
			if(strmatch(vInfo[i][vOwner], GetName(playerid)))
			{	
				if(IsVehSpawned(i) == 1) format(gString, sizeof(gString), "Masina\tStatus\n{FFFFFF}%s\t{33AA33}Spawnat\n", VehicleNames[vInfo[i][vModel] - 400]);
				else format(gString, sizeof(gString), "Masina\tStatus\n{FFFFFF}%s\t{33AA33}Despawnat\n", VehicleNames[vInfo[i][vModel] - 400]);
				strcat(var, gString);
			}
		}
		SPD(playerid, DIALOG_VEHICLES, DIALOG_STYLE_TABLIST_HEADERS, szTitle, var, "Selecteaza", "Anuleaza");
	}
	return 1;
}

Functia, care cred ca are problema:

function GetVehNumber(playerid)
{
	new nr = 0;
	for(new i = 1; i <= Total_Veh_Created; i++) if(strmatch(vInfo[i][vOwner], GetName(playerid)) && !vInfo[i][vType]) nr ++;
	return nr;
}

 

5 answers to this question

Recommended Posts

  • 0
  • Administrator
Posted

Verificarea asta

strmatch(vInfo[i][vOwner], GetName(playerid))

ce iti returneaza? Nu stiu functia asta si nici nu imi aduc aminte sa fie in SA-MP, dar foloseste strcmp.

  • 0
Posted
9 hours ago, WopsS said:

Verificarea asta


strmatch(vInfo[i][vOwner], GetName(playerid))

ce iti returneaza? Nu stiu functia asta si nici nu imi aduc aminte sa fie in SA-MP, dar foloseste strcmp.

Iti verifica daca ai masina personala sau, nu ai masina personala.

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.