SA-MP Forums Archive
CMD:track - 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: CMD:track (/showthread.php?tid=634358)



CMD:track - Loinal - 17.05.2017

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";
        } 



Re: CMD:track - Loinal - 17.05.2017

Sorry i mean

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



Re: CMD:track - Mohaaaaaaaaaaa - 17.05.2017

You want to check if he is registered?


Re: CMD:track - Loinal - 17.05.2017

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


Re: CMD:track - Mohaaaaaaaaaaa - 17.05.2017

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");


Re: CMD:track - Feynman - 17.05.2017

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

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



Re: CMD:track - Loinal - 17.05.2017

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

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


Re: CMD:track - Beckett - 18.05.2017

It's the exact same thing.


Re: CMD:track - saffierr - 18.05.2017

I'd use a boolean for this.