Posts: 716
Threads: 92
Joined: May 2018
Quote:
Originally Posted by ConnorW
In the command you do:
PHP код:
if(yourvipvariable[playerid] == 0) //if the player vip level is 0
{
return SendClientMessage(playerid, -1, "You are not VIP");
}
|
No need to waste 3 lines for a simple message...
pawn Код:
if(yourvipvariable[playerid] == 0) return SendClientMessage(playerid, -1, "You are not VIP");
Or
pawn Код:
if(!yourvipvariable[playerid][Vip]) return SendClientMessage(playerid, -1, "You are not VIP");
Posts: 716
Threads: 92
Joined: May 2018
Quote:
Originally Posted by RogueDrifter
Really? Lmfao. And why exactly shouldn't he waste more lines to get a clear looking code?
|
A clear looking code, 2 brackets, 1 return, for what? Sending a simple message.
If you think this:
pawn Код:
if (Player[playerid][AccountLevel] < 3) return bla bla;
It's worst than this:
pawn Код:
if (Player[playerid][AccountLevel] < 3)
{
return bla bla;
}
Are your tastes. However i prefer the first. especially when you have a lot of checks. No need to seriously waste 3 lines....but again, tastes.