SA-MP Forums Archive
strcat help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: strcat help (/showthread.php?tid=227709)



strcat help - Haydz - 18.02.2011

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;
}



Re: strcat help - Krx17 - 18.02.2011

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.");