Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include < a_samp >
- new
- sfb[ MAX_PLAYERS ],
- gUsesBoard[ MAX_PLAYERS ],
- btimer[ MAX_PLAYERS ]
- ;
- public OnPlayerCommandText( playerid, cmdtext[ ] ) {
- if( !strcmp( cmdtext, "/board", true ) ) {
- if( gUsesBoard[ playerid ] == 0 ) {
- new
- Float:x
- ,Float:y
- ,Float:oz
- ;
- GetPlayerPos( playerid, x, y, oz );
- new Float:a;
- GetPlayerFacingAngle( playerid, a );
- oz = oz + -1.01;
- sfb[ playerid ] = CreateObject(2404, x, y + 0.12, oz, -90.00, 0.00, a);
- btimer[ playerid ] = SetTimerEx( "board", 20, 1, "if", playerid, oz );
- gUsesBoard[ playerid ] = 1;
- }
- else {
- KillTimer( btimer[ playerid ] );
- gUsesBoard[ playerid ] = 0;
- DestroyObject( sfb[ playerid ] );
- }
- return 1;
- }
- return 0;
- }
- forward board( playerid, Float:oz );
- public board( playerid, Float:oz ) {
- new
- Float:x
- ,Float:y
- ,Float:z2
- ,Float:a
- ;
- GetPlayerPos( playerid, x, y, z2 );
- #pragma unused z2
- SetObjectPos( sfb[ playerid ], x, y + 0.12, oz );
- GetPlayerFacingAngle( playerid, a );
- SetObjectRot( sfb[ playerid ], -90.00, 0.00, a );
- return 1;
- }
- public OnPlayerDisconnect( playerid, reason ) {
- if( gUsesBoard[ playerid ] == 1 ) {
- KillTimer( btimer[ playerid ] );
- gUsesBoard[ playerid ] = 0;
- DestroyObject( sfb[ playerid ] );
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement