Value -> String [ REP + ] -
_GHT_MarK445 - 06.04.2015
Hey dear guys!
I need help, how i am enable to do, for example i have:
PlayerInfo[playerid][Carschool]
if it is set to 0, it will show in my /stats command "Not owned" and if it is set to 1, it will show "Owned"
Like how i am enable to do it, thank you guys!
Respuesta: Value -> String [ REP + ] -
admantis - 06.04.2015
PHP код:
new owned[10];
if(PlayerInfo[playerid][Carschool] == 1) owned = "Owned";
else owned = "Not Owned";
Easy as that!
Re: Value -> String [ REP + ] -
_GHT_MarK445 - 06.04.2015
Well, i did it just like you helped me but.
When i inserted it in my /stats command, like this:
Код:
format(str,sizeof(str),"{FFFFFF}Carschool: {00FF80}%s\n",PlayerInfo[playerid][Carschool]);
strcat(string, str);
It was showing literaly nothing in the /stats command, like i mean there was all other stuff, but in "Carschool" after the : there was nothing, it was just blank space.
Re: Value -> String [ REP + ] -
EiresJason - 06.04.2015
You need to insert the string 'owned' instead of the integer ..[Carschool].
pawn Код:
format(str,sizeof(str),"{FFFFFF}Carschool: {00FF80}%s\n", owned);
strcat(string, str);
Re: Value -> String [ REP + ] -
_GHT_MarK445 - 06.04.2015
Ohh, i am blind noob. Sorry for that.. and thank you verry much! REP+ to both of you guys.
AW: Value -> String [ REP + ] -
Mencent - 06.04.2015
Hello!
You can do also this:
PHP код:
format(str,sizeof(str),"{FFFFFF}Carschool: {00FF80}%s\n",(PlayerInfo[playerid][Carschool]) ? ("Owned") : ("Not owned"));
strcat(string, str);
You needn't do this if you use my code:
PHP код:
new owned[10];
if(PlayerInfo[playerid][Carschool] == 1) owned = "Owned";
else owned = "Not Owned";
Mencent
Re: Value -> String [ REP + ] -
_GHT_MarK445 - 06.04.2015
Well, thank you for the support but i will rather use the code, which is already working for me and i really understand it and know, what is going on. I for some reason cant understand why, and how you putted there the names and such, so i will better use something that i understand and have no problems with it.