Fishing Help
#4

You could just use strval from index 1 so that the dollar symbol wouldn't be included:
pawn Код:
GivePlayerMoney( playerid, strval( FishNames[ FishName ][ 1 ] ));
The string "$500" is built up like this:
pawn Код:
FishNames[ FishName ][ 0 ] = '$'
FishNames[ FishName ][ 1 ] = '5'
FishNames[ FishName ][ 2 ] = '0'
FishNames[ FishName ][ 3 ] = '0'
FishNames[ FishName ][ 4 ] = '\0' //null - end of string
So when you get the value of the string (string to int) but start on index 1, the first index ([0]) will be excluded, thus making your code work just like intended.

I'm sorry if you already knew this, I just like to explain just in case.
Reply


Messages In This Thread
Fishing Help - by AphexCCFC - 06.02.2013, 18:41
Re: Fishing Help - by LarzI - 06.02.2013, 19:03
Re: Fishing Help - by AphexCCFC - 06.02.2013, 19:14
Re: Fishing Help - by LarzI - 06.02.2013, 19:34
Re: Fishing Help - by AphexCCFC - 06.02.2013, 21:52

Forum Jump:


Users browsing this thread: 1 Guest(s)