This or That?
#1

Which one is correct..
This:
pawn Код:
if(strcmp(cmd, "/coin", true) == 0)
    {
        if(IsDown[playerid] == 1 || IsDown[playerid] == 2) { return SendClientMessage(playerid,0xFF0000AA,"You can't do this while incapacitated."); }
        if(IsPlayerConnected(playerid))
        {
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new coin = random(2)+1;
            new coinname[20];
            if(coin == 1) { coinname = "head"; }
            else { coinname = "tail"; }
            format(string, sizeof(string), "*%s flips a coin that lands on a %s", sendername,coinname);
            ProxDetector(8.0, playerid, string,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA);
        }
        if(Masked[playerid] == 1) string = "*Stranger flips a coin that lands on a %s";
        else format(string, sizeof(string), "*%s flips a coin that lands on a %s", sendername,coinname);
        ProxDetector(8.0, playerid, string,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA);
        return 1;
    }
or that:
pawn Код:
if(strcmp(cmd, "/coin", true) == 0)
    {
        if(IsDown[playerid] == 1 || IsDown[playerid] == 2) { return SendClientMessage(playerid,0xFF0000AA,"You can't do this while incapacitated."); }
        if(IsPlayerConnected(playerid))
        {
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new coin = random(2)+1;
            new coinname[20];
            if(coin == 1) { coinname = "head"; }
            else { coinname = "tail"; }
        }
        if(Masked[playerid] == 1) string = "*Stranger flips a coin that lands on a %s";
        else format(string, sizeof(string), "*%s flips a coin that lands on a %s", sendername,coinname);
        ProxDetector(8.0, playerid, string,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA);
        return 1;
    }
Reply
#2

Why don't you try it instead of waiting for replies..
Reply
#3

I'd improve it a bit.

pawn Код:
if(!strcmp(cmd, "/coin", true))
{
    if(IsDown[playerid] == 1 || IsDown[playerid] == 2) return SendClientMessage(playerid,0xFF0000AA,"You can't do this while incapacitated.");
    if(Masked[playerid] == 1) format(string, sizeof(string), "*Stranger flips a coin that lands on a %s", (random(2) == 1) ? ("head") : ("tail"));
    else
    {
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string), "*%s flips a coin that lands on a %s", sendername, (random(2) == 1) ? ("head") : ("tail"));
    }
    ProxDetector(8.0, playerid, string,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA);
    return 1;
}
Reply
#4

Thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)