Strings - 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)
+--- Thread: Strings (
/showthread.php?tid=584774)
Strings -
SumX - 07.08.2015
I use command /wanted [Player's name] [Level] [Reason].
I am already saving the wanted Level in player's account, but how can I save all the reasons when someone get's wanted? I am using PVars. I tried with SetPVarString and GetPVarString but its not going on so well.
example:
/wanted SumX 1 Robbery
/wanted SumX 3 Steal Car
/wanted SumX 2 Cop attack
/wanted SumX 2 Murder
SumX .ini account when he logs out will look like this:
SumX
WANTEDLEVEL = 8
WANTEDREASONS = Robbery\nSteal Car\n Cop attack\n Murder
Thank you!
Re: Strings -
SumX - 07.08.2015
No. I am using Y_ini saving. I am saving all my player's variables.
I want to create a new string variable and there to save all the wanted reason, in his .ini account.
Re: Strings -
Banana_Ghost - 08.08.2015
eh...you can take the string you're saving it to and do something like
PHP код:
// For example, PlayerInfo[playerid][WantedReasons] is where the reasons are stored, it's size is maybe 128.
strcat(PlayerInfo[playerid][WantedReasons], "Cop Attack\n", 128);
// This will append the current information to the prior and add a new line for the next added crime.
Re: Strings -
SumX - 08.08.2015
Hmm, thank you, I think I understand, but how to do that if using PVars?
All my saving and loading system is based on SetPVar, GetPVar...