19.05.2018, 23:22
600 is too large for a string mate.
Change ncar[600] to the maximum size of car name, and "sT[600]" to "s[maximum size of car name]"
You're also missing closing brackets;
Change ncar[600] to the maximum size of car name, and "sT[600]" to "s[maximum size of car name]"
You're also missing closing brackets;
PHP код:
CMD:searchcar(playerid,params[])
{
new idvp,ncar[30],StringSECH[1140],STRCCHAR[1140];
if(sscanf(params,"sT[30]",ncar)) return SendClientMessage(playerid,red,"Use: /searchcar [carname]");
idvp = GetVehicleModelIDFromName(ncar);
for(new i=0;i<MAX_VEHICLES;i++){
if(VehicleInfo[playerid][Model] == idvp && VehicleInfo[playerid][Temp] == false){
format(StringSECH,sizeof(StringSECH),"{FFFAFA}Vehicle:{00FF00} %s | {FFFAFA}Owner:{00FF00} %s\n",VehicleName[GetVehicleModel(i)-400],VehicleInfo[i][owner],i);
strcat(STRCCHAR,StringSECH);}}
ShowPlayerDialog(playerid,601,DIALOG_STYLE_MSGBOX ,"{FFFF00}Search Car",STRCCHAR, "Ok", "");
}
}
return 1;
}