/bonus > nefungue
#1

Cau lidi tak vcera sem si nakodil takovej malej scriptik a dnes kdyz sem zkousel mod tak ten script blbne kod:

Код:
dcmd_bonus(playerid, params[])
{
#pragma unused params
if(IsPlayerConnected(playerid))
{
new bool:bonused[MAX_PLAYERS] = true;
if(bonused[playerid] == false)
{
bonused[playerid] = true;
EnableStuntBonusForPlayer(playerid, 1);
SendClientMessage(playerid, BARVA_ZELENA, "Prave jsis zapnul ukazovani bonusu.");
}
else if(bonused[playerid] == true)
{
bonused[playerid] = false;
EnableStuntBonusForPlayer(playerid, 0);
SendClientMessage(playerid, BARVA_ZELENA, "Prave jsis vypnul ukazovani bonusu.");
}
}
return true;
}
Vzdy kdyz zadam prikaz: /bonus tak se vzdy ukaze pouze: Prave jsis vypnul ukazovani bonusu.
A ja uz nwm vcem je problem tak pls help. Predem diky

I'm Czech :P xD
Reply
#2

Pls help
Reply
#3

This is a english ONLY speaking forum. Please re-type your post in english.
Reply
#4

It is the command does not work, always proves the same text.
Reply
#5

You keep creating the variable in the command, so you would keep getting the message:
"Prave jsis zapnul ukazovani bonusu."

Do this:

Under OnGameModeInit:

pawn Код:
new bool:bonused[MAX_PLAYERS] = true;
the command:
pawn Код:
dcmd_bonus(playerid, params[])
{
    #pragma unused params
    if(IsPlayerConnected(playerid))
    {
        if(bonused[playerid] == false)
        {
            bonused[playerid] = true;
            EnableStuntBonusForPlayer(playerid, 1);
            SendClientMessage(playerid, BARVA_ZELENA, "Prave jsis zapnul ukazovani bonusu.");
        }
        else if(bonused[playerid] == true)
        {
            bonused[playerid] = false;
            EnableStuntBonusForPlayer(playerid, 0);
            SendClientMessage(playerid, BARVA_ZELENA, "Prave jsis vypnul ukazovani bonusu.");
        }
    }
    return true;
}
Reply
#6

Quote:
Originally Posted by [B2K
Hustler ]
You keep creating the variable in the command, so you would keep getting the message:
"Prave jsis zapnul ukazovani bonusu."

Do this:

Under OnGameModeInit:

pawn Код:
new bool:bonused[MAX_PLAYERS] = true;
the command:
pawn Код:
dcmd_bonus(playerid, params[])
{
    #pragma unused params
    if(IsPlayerConnected(playerid))
    {
        if(bonused[playerid] == false)
        {
            bonused[playerid] = true;
            EnableStuntBonusForPlayer(playerid, 1);
            SendClientMessage(playerid, BARVA_ZELENA, "Prave jsis zapnul ukazovani bonusu.");
        }
        else if(bonused[playerid] == true)
        {
            bonused[playerid] = false;
            EnableStuntBonusForPlayer(playerid, 0);
            SendClientMessage(playerid, BARVA_ZELENA, "Prave jsis vypnul ukazovani bonusu.");
        }
    }
    return true;
}
Thank you, it works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)