Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //by Seregamil
- #include a_samp
- #include sscanf2
- #define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
- #define couch_object 1
- new couch = INVALID_OBJECT_ID ;
- new couch_speed = 10 ;
- public OnGameModeInit(){
- return true;
- }
- public OnGameModeExit(){
- return true;
- }
- public OnPlayerCommandText(playerid, cmdtext[]){
- dcmd(Couch, 5, cmdtext);
- dcmd(Speed, 5, cmdtext);
- dcmd(Move, 4, cmdtext);
- return false;
- }
- dcmd_Move( playerid, params[] ){
- #pragma unused playerid
- if( sscanf( params, "fff", params[ 0 ], params[ 1 ], params[ 2 ] ) )
- return true;
- MoveObject( couch, params[ 0 ], params[ 1 ], params[ 2 ], couch_speed );
- return true;
- }
- dcmd_Speed( playerid, params[] ){
- #pragma unused playerid
- new speed = strval( params );
- if( 0 < speed < 1000 )
- couch_speed = speed;
- return true;
- }
- dcmd_Couch( playerid, params[] ){
- #pragma unused params
- new Float: x, Float: y, Float: z;
- GetPlayerPos( playerid, x, y, z );
- if( couch != INVALID_OBJECT_ID )
- DestroyObject( couch );
- couch = CreateObject( couch_object, x, y, z, 0.0, 0.0, 0.0, 100.0 );
- return true ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement