strcat help
#1

Hey guys, the wiki wasn't very clear on how i merge all the strings together and was just asking if somebody could explain it more.

strcat - https://sampwiki.blast.hk/wiki/Strcat
pawn Код:
command(mycars,playerid,params[])
{
    for(new i=1;i<MAX_VEHICLES;i++)
    {
        if(strmatch(VehicleInfo[i][Owner],GetName(playerid)))
        {
            new Float:x,Float:y,Float:z;
            GetVehiclePos(i,x,y,z);
            new string[100];
            strcat(string, "%s\n",VehicleNames[VehicleInfo[i][Model]-400]);
            strcat(string, "%s\n",VehicleNames[VehicleInfo[i][Model]-400]);
            strcat(string, "%s",VehicleNames[VehicleInfo[i][Model]-400]);
                ShowPlayerDialog(playerid, MYCARS, DIALOG_STYLE_LIST, "Your vehicles", string, "Locate", "Exit");
        }
    }
    return 1;
}
Reply
#2

It adds the destination string to the source string at the end of it.

pawn Код:
new string[100];
strcat(string, "Hello");
strcat(string, " my name is ");
strcat(string, "\n\t the foo fighter.");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)