Showplayerstats ^^,
#1

Hi, i was create my playerstats

but if i do /stats i see then the 3 lines :/

Код:
if(PlayerInfo[playerid][pLicenseA] == 1 || PlayerInfo[playerid][pLicenseB] == 1 || PlayerInfo[playerid][pLicenseC] == 1)
{
	SendClientMessage(playerid, COLOR_WHITE, "Flying License: yes | Boat License: yes | Driver License: yes");
}
if(PlayerInfo[playerid][pLicenseA] == 0 || PlayerInfo[playerid][pLicenseB] == 0 || PlayerInfo[playerid][pLicenseC] == 0)
{
	SendClientMessage(playerid, COLOR_WHITE, "Flying License: no | Boat License: no | Driver License: no");
}
if(PlayerInfo[playerid][pLicenseA] == 0 || PlayerInfo[playerid][pLicenseB] == 1 || PlayerInfo[playerid][pLicenseC] == 0)
{
	SendClientMessage(playerid, COLOR_WHITE, "Flying License: no | Boat License: yes | Driver License: no");
}
if(PlayerInfo[playerid][pLicenseA] == 1 || PlayerInfo[playerid][pLicenseB] == 0 || PlayerInfo[playerid][pLicenseC] == 0)
{
	SendClientMessage(playerid, COLOR_WHITE, "Flying License: yes | Boat License: no | Driver License: no");
}
if(PlayerInfo[playerid][pLicenseA] == 0 || PlayerInfo[playerid][pLicenseB] == 0 || PlayerInfo[playerid][pLicenseC] == 1)
{
	SendClientMessage(playerid, COLOR_WHITE, "Flying License: no | Boat License: no | Driver License: yes");
}
screenshot

Reply
#2

All things you made there can you do in only 3 script lines.. Why so difficult?
Use format method and define 0 as NO and 1 as YES.
Reply
#3

Use && instead of || Example: if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][AdminLevel] >= 1) becomes if(IsPlayerAdmin(playerid) && PlayerInfo[playerid][AdminLevel] >= 1)
Reply
#4

Quote:
Originally Posted by » RyDeR «
All things you made there can you do in only 3 script lines.. Why so difficult?
Use format method and define 0 as NO and 1 as YES.
how :$
Reply
#5

Untested, might work, if it doesn't just re-do it, I guess you got how I ment it.

pawn Код:
new
    lic_str[ 3 ][ 5 ],
    output[ 94 ];
   
if(PlayerInfo[playerid][pLicenseA]) lic_str[0] = "Yes"; else lic_str[0] = "No";
if(PlayerInfo[playerid][pLicenseB]) lic_str[1] = "Yes"; else lic_str[1] = "No";
if(PlayerInfo[playerid][pLicenseC]) lic_str[2] = "Yes"; else lic_str[2] = "No";

format(output, sizeof(output), "Flying License: %s | Boat License: %s | Driver License: %s", lic_str[0], lic_str[1], lic_str[2]);
SendClientMessage(playerid, COLOR_WHITE, output);
Reply
#6

Код:
	new NoOrYes[2][]={"No","Yes"};
	new String[128];
	format(String, sizeof(String), "Flying License: %s | Boat License: %s | Driver License: %s", NoOrYes[PlayerInfo[playerid][pLicenseA]], NoOrYes[PlayerInfo[playerid][pLicenseB]], NoOrYes[PlayerInfo[playerid][pLicenseC]]);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)