Something wrong with this and ID 0?
#1

HERE is the code.

I am having a weird problem, which I am unsure of what it is.
If, for example, ID 2 is the name Savvy, which I want, then they are the only ones who can use this /partybus command.

That works, but it will only change the colours of ID 0's car if they are in one.

I am not sure what is wrong, but I assume it's something with the ChangeCarColour(playerid) callback I made.

Anyway, all help will be appreciated.
Reply
#2

pawn Код:
cmd(partybus, playerid, params[])
{
    if(!strcmp(GetName(playerid), "Savvy", true))
        return 1;

    if(!IsPlayerInAnyVehicle(playerid))
        return SendClientMessage(playerid, -1, "You must be in a vehicle for this to work!");

    if(GetPlayerVehicleSeat(playerid) != 0)
        return SendClientMessage(playerid, -1, "You must be the driver to use this command!");

    if(PartyBusOn[playerid])
        return SendClientMessage(playerid, -1, "Party Bus is already enabled!");

    SendClientMessage(playerid, -1, "Party Bus enabled!");
    CCC = SetTimer("ChangeCarColour", 100, true, "d", playerid);
    PartyBusOn[playerid] = 1;
    return 1;
}
Reply
#3

Did you even change anything?
Reply
#4

Use this
Код:
* * SendClientMessage(playerid, -1, "Party Bus enabled!");
* * CCC = SetTimer("ChangeCarColour", 100, true, "d", playerid);
* * PartyBusOn[playerid] = 1;
* * return 1;
}
I changed "u" to "d" it will work now
Reply
#5

Quote:
Originally Posted by Craft.
Посмотреть сообщение
Use this
Код:
* * SendClientMessage(playerid, -1, "Party Bus enabled!");
* * CCC = SetTimer("ChangeCarColour", 100, true, "d", playerid);
* * PartyBusOn[playerid] = 1;
* * return 1;
}
I changed "u" to "d" it will work now
It was always "d".
Reply
#6

settimerex
Reply
#7

Quote:
Originally Posted by sampreader
Посмотреть сообщение
settimerex
Wow, missed such a simple thing!
Haha, thanks.
Reply
#8

Must have been a bug on my screen sorry
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)