Help, please. - 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: Help, please. (
/showthread.php?tid=516744)
Help, please. -
Edu4rd - 01.06.2014
rezolvat
Re: Help, please. -
Edu4rd - 01.06.2014
I mean when you /licenses and have pCarLicTime to 0 to not show [Expires in %d hours] but [expired]
Re: Help, please. -
Eth - 01.06.2014
pawn Код:
if(strcmp(cmd,"/licenses",true)==0)
{
if(IsPlayerConnected(playerid))
{
new timplic = PlayerInfo[playerid][pCarLicTime];
new atext[20];
if(PlayerInfo[playerid][pCarLicTime] == 0) { atext = "Expirata"; }
new text1[20];
if(PlayerInfo[playerid][pCarLicense]) { text1 = "{00FF00}Da"; } else { text1 = "{FF0000}Nu"; }
if(PlayerInfo[playerid][pCarLicTime] != 0)
{
format(string, sizeof(string), "{FFFFFF}Permis conducere: %s {FFFFFF} [Expira in %d ore]", text1,timplic);
ShowPlayerDialog(playerid, 94, DIALOG_STYLE_MSGBOX, "Licente",string, "Iesire", "");
}
if(PlayerInfo[playerid][pCarLicTime] == 0)
{
format(string, sizeof(string), "{FFFFFF}Permis conducere: %s", atext,timplic);
ShowPlayerDialog(playerid, 94, DIALOG_STYLE_MSGBOX, "Licente",string, "Iesire", "");
}
return 1;
}
Re: Help, please. -
Edu4rd - 01.06.2014
fixed
Re: Help, please. -
Eth - 01.06.2014
do something like this:
pawn Код:
if(strcmp(cmd,"/licenses",true)==0)
{
if(IsPlayerConnected(playerid))
{
new timplic = PlayerInfo[playerid][pCarLicTime];
new atext[20];
if(PlayerInfo[playerid][pCarLicTime] == 0) { atext = "Expirata"; }
new text1[20];
if(PlayerInfo[playerid][pCarLicense]) { text1 = "{00FF00}Da"; } else { text1 = "{FF0000}Nu"; }
if(PlayerInfo[playerid][pCarLicTime] != 0)
{
format(string, sizeof(string), "{FFFFFF}Permis conducere: %s {FFFFFF} [Expira in %d ore]", text1,timplic);
ShowPlayerDialog(playerid, 94, DIALOG_STYLE_MSGBOX, "Licente",string, "Iesire", "");
}
if(PlayerInfo[playerid][pCarLicTime] == 0 || PlayerInfo[playerid][liscense here] == 0)
{
format(string, sizeof(string), "{FFFFFF}Permis conducere: %s", atext,timplic);
ShowPlayerDialog(playerid, 94, DIALOG_STYLE_MSGBOX, "Licente",string, "Iesire", "");
}
return 1;
}
the || means that if you have one of them with the time 0
Re: Help, please. -
Edu4rd - 01.06.2014
Fixedd