Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- TODO:
- */
- #include <ysilib\YSI_Coding\y_hooks>
- #define INDEX_SKATE (0)
- enum skate
- {
- bool:sActive,
- sSkate,
- };
- new InfoSkate[MAX_PLAYERS][skate];
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(InfoSkate[playerid][sActive] && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- static bool:act;
- SetPlayerArmedWeapon(playerid,0);
- if(newkeys & KEY_HANDBRAKE)
- {
- ApplyAnimation(playerid, "SKATE","skate_run",4.1,1,1,1,1,1,1);
- if(!act)
- {
- act = true;
- RemovePlayerAttachedObject(playerid,INDEX_SKATE);
- DestroyObject(InfoSkate[playerid][sSkate]);
- InfoSkate[playerid][sSkate] = CreateObject(19878,0,0,0,0,0,0);
- AttachObjectToPlayer(InfoSkate[playerid][sSkate],playerid, -0.2,0,-0.9,0,0,90);
- }
- }
- if(oldkeys & KEY_HANDBRAKE)
- {
- ApplyAnimation(playerid, "CARRY","crry_prtial",4.0,0,0,0,0,0);
- if(act)
- {
- act = false;
- DestroyObject(InfoSkate[playerid][sSkate]);
- RemovePlayerAttachedObject(playerid,INDEX_SKATE);
- SetPlayerAttachedObject(playerid,INDEX_SKATE,19878,6,-0.055999,0.013000,0.000000,-84.099983,0.000000,-106.099998,1.000000,1.000000,1.000000);
- }
- }
- }
- return true;
- }
- YCMD:skate(playerid,params[], help)
- {
- if(!IsPlayerInAnyVehicle(playerid))
- {
- ApplyAnimation(playerid, "CARRY","null",0,0,0,0,0,0,0);
- ApplyAnimation(playerid, "SKATE","null",0,0,0,0,0,0,0);
- ApplyAnimation(playerid, "CARRY","crry_prtial",4.0,0,0,0,0,0);
- SetPlayerArmedWeapon(playerid,0);
- if(!InfoSkate[playerid][sActive])
- {
- InfoSkate[playerid][sActive] = true;
- DestroyObject(InfoSkate[playerid][sSkate]);
- RemovePlayerAttachedObject(playerid,INDEX_SKATE);
- SetPlayerAttachedObject(playerid,INDEX_SKATE,19878,6,-0.055999,0.013000,0.000000,-84.099983,0.000000,-106.099998,1.000000,1.000000,1.000000);
- PlayerPlaySound(playerid,21000,0,0,0);
- }
- else
- {
- InfoSkate[playerid][sActive] = false;
- DestroyObject(InfoSkate[playerid][sSkate]);
- RemovePlayerAttachedObject(playerid,INDEX_SKATE);
- PlayerPlaySound(playerid,21000,0,0,0);
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement