SA-MP Forums Archive
Something wrong with this and ID 0? - 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: Something wrong with this and ID 0? (/showthread.php?tid=350953)



Something wrong with this and ID 0? - cosbraa - 14.06.2012

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.


Re: Something wrong with this and ID 0? - Riddick94 - 14.06.2012

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



Re: Something wrong with this and ID 0? - cosbraa - 14.06.2012

Did you even change anything?


Re: Something wrong with this and ID 0? - Craft. - 14.06.2012

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


Re: Something wrong with this and ID 0? - cosbraa - 14.06.2012

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".


Re: Something wrong with this and ID 0? - sampreader - 14.06.2012

settimerex


Re: Something wrong with this and ID 0? - cosbraa - 14.06.2012

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


Re: Something wrong with this and ID 0? - Craft. - 14.06.2012

Must have been a bug on my screen sorry