Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- // 0-3, 1-4, 2-5, 3-6, 4-7, 5-0, 6-1, 7-2
- new
- gTick = 0,
- gPattern[1 char]; // to make it 8 bytes wide instead of 32
- main()
- {
- gPattern{0} = 0b11110000;
- tick();
- }
- forward tick();
- public tick()
- {
- if(gTick > 7)
- gTick = 0;
- printf("%d : %08b", gTick, gPattern{0});
- for(new i; i < 8; i++)
- {
- if(gPattern{0} & (1 << i))
- {
- // light the LED
- printf(" light LED %d", i);
- }
- else
- {
- // shut off the LED
- printf(" deactivate LED %d", i);
- }
- }
- gPattern{0} = (gPattern{0} >> 1) | (gPattern{0} << 7);
- gTick += 1;
- SetTimer("tick", 1000, false);
- }
- public OnPlayerSpawn(playerid)
- {
- SetPlayerPos(playerid, 0.0, 0.0, 3.0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement