CMD:track
#1

Hello, Iam making /track so

Should i use this?

PHP код:
if(IsPlayerRegisterd[id] == 1Reg "Yes"; else Reg "No"
or

PHP код:
        if(IsPlayerRegisterd[id] == 1)
        {
            case 
0Reg "Yes";
            case 
1Reg "No";
        } 
Reply
#2

Sorry i mean

PHP код:
        switch (IsPlayerRegisterd[id])
        {
            case 
0Reg "Yes";
            case 
1Reg "No";
        } 
Reply
#3

You want to check if he is registered?
Reply
#4

Quote:
Originally Posted by Mohaaaaaaaaaaa
Посмотреть сообщение
You want to check if he is registered?
Yea i want to check and dialog it but i only asking which is best to use
Reply
#5

Why don't you create a bool:LoggedIn and check if for example if(Player[playerid][LoggedIN] == false) return SendClientMessage(playerid,-1,"{FFFFFF}Error:You must be registered in");
Reply
#6

You can also do this using ternary operator. Simple and neat.

Код HTML:
strcat(string, (IsPlayerRegisterd[id]) ? ("Yes") : ("No"));
Reply
#7

Quote:
Originally Posted by Feynman
Посмотреть сообщение
You can also do this using ternary operator. Simple and neat.

Код HTML:
strcat(string, (IsPlayerRegisterd[id]) ? ("Yes") : ("No"));
Thanks
Reply
#8

It's the exact same thing.
Reply
#9

I'd use a boolean for this.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)