23.10.2015, 22:43
Quote:
level=strval(sta[5]);
Try this. Use this instead of the second sscanf. Also use isnull() and IsNumeric() For MYID Skill Driving 5, sscanf(params, "us[126]", id, sta) Then, strcmp(sta, "MYID", true) Then, format(sta2, "%s", sta[4]); Then, strcmp(sta2, "skill", true) Then, format(sta3, "%s", sta2[5]); Then, strcmp(sta3, "driving", true) Then, isnull(sta3[7]), IsNumeric(sta3[7]), and level=strval(sta[7]); |
/setstats (id) Skill Driving 5
that means letter 'l' in the skill, you are assigning it to sta2, then asking for 6th character of sta2, which is absolutely nothing, assigning it to sta3
IF you don't know how to do it, there is no need to give some random vague answer, since I was confused af while reading your "help", let alone the poor guy looking for his answer.
I really wish this REP system would be removed, people do so much to get one !
OT:
You should re-sscanf the string sta, get the "stats" cmd wants to change in one string, rest to another, check what stat that is, see how many arguments it needs, then sscanf the "another" string to match your needs, sta you are creating is a 126 cell big, that means pretty much anything they type after /setstats id, if someone types /setstats 0 level something big here 5, this level something big here 5 gets saved in your sta string, which obviously doesn't match "level" you want to check
PS: there are better ways to do this, but it's midnight, this was the best I came up with, so don't shoot me plz :3