Strcat Help -
AphexCCFC - 07.02.2013
pawn Код:
strcat(PlayerInfo[playerid][pFishName1], FishNames[FishName]);
This doesn't seem to work, but I want PlayerInfo[playerid][pFishName1] to be set as FishNames[FishName]
under FishNames[FishName] I have "Clownfish", "Shark" etc.
Re: Strcat Help -
Jefff - 07.02.2013
You must set maxlenght after FishNames[FishName], size PlayerInfo[playerid][pFishName1]
Re: Strcat Help -
AphexCCFC - 07.02.2013
pawn Код:
new FishName = random(sizeof(FishNames));
I have this.
Re: Strcat Help - T0pAz - 07.02.2013
What's wrong with it?
Re: Strcat Help -
AphexCCFC - 07.02.2013
^ This works, it's just not working when I want to join it together with my PlayerInfo[playerid][pFishName1] variable.
Re: Strcat Help -
AphexCCFC - 07.02.2013
Basically, I have a /fish command, everything works fine, except I want "PlayerInfo[playerid][pFishName1]" to display whats in "FishNames[FishName]".
pawn Код:
new FishNames[][] =
{
"Shark",
"Clownfish",
"Angelfish",
"Catfish",
"Dogfish",
"Eel"
};
Which is one of these selected at random.
Re: Strcat Help -
AphexCCFC - 07.02.2013
Anyone know?
Re: Strcat Help - T0pAz - 07.02.2013
What's the size of fishname1?
Re: Strcat Help -
AphexCCFC - 07.02.2013
pawn Код:
enum pInfo
{
pLevel,
pGender,
pCash,
pBank,
pJob,
pBirthDate,
pBirthMonth,
pBirthYear,
pAdminLevel,
pAdminDuty,
pSkin,
pFishPermit,
pFish1,
pFish2,
pFish3,
pFish4,
pFish5,
pFishes,
Float:pPosX,
Float:pPosY,
Float:pPosZ,
Float:pPosA,
pRegistered,
pFishName1,
pFishName2,
pFishName3,
pFishName4,
pFishName5,
pFishNames,
pFishingRod,
pRodDurab,
pBait
}
This is all I have for the FishName1 variable.
Re: Strcat Help - T0pAz - 07.02.2013
String must be in array as it's a group of characters.
pawn Код:
enum pInfo
{
pLevel,
pGender,
pCash,
pBank,
pJob,
pBirthDate,
pBirthMonth,
pBirthYear,
pAdminLevel,
pAdminDuty,
pSkin,
pFishPermit,
pFish1,
pFish2,
pFish3,
pFish4,
pFish5,
pFishes,
Float:pPosX,
Float:pPosY,
Float:pPosZ,
Float:pPosA,
pRegistered,
pFishName1[16],
pFishName2[16],
pFishName3[16],
pFishName4[16],
pFishName5[16],
pFishNames,
pFishingRod,
pRodDurab,
pBait
}
Try that^