Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- new bola;
- public OnFilterScriptInit()
- {
- print(" * Sistema de jogar futebol - [TUI]Dan ~ DanDRT");
- bola = CreateObject(1598, 1347.44,2149.91,10.3156, 0, 0, 0);
- return 1;
- }
- public OnFilterScriptExit()
- return 1;
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- new Float:OPos[3], Float:PPos[3];
- GetObjectPos(bola, OPos[0], OPos[1], OPos[2]);
- GetPlayerPos(playerid, PPos[0], PPos[1], PPos[2]);
- if(((newkeys & KEY_HANDBRAKE) || (newkeys & KEY_SPRINT)) && GetPVarInt(playerid, "Foot"))
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.7, OPos[0], OPos[1], OPos[2]))
- {
- GetXYInFrontOfPlayer(playerid, PPos[0], PPos[1], 7.0);
- MoveObject(bola, PPos[0], PPos[1], 10.3156, 10.0);
- ApplyAnimation(playerid,"FIGHT_D","FightD_1",4.1,0,1,1,0,0);
- }
- }
- return 1;
- }
- GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
- {
- new Float:a;
- GetPlayerPos(playerid, x, y, a);
- GetPlayerFacingAngle(playerid, a);
- if (GetPlayerVehicleID(playerid))
- GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
- x += (distance * floatsin(-a, degrees));
- y += (distance * floatcos(-a, degrees));
- }
- CMD:jogar(playerid)
- {
- SetPVarInt(playerid, "Foot", !GetPVarInt(playerid, "Foot"));
- SendClientMessage(playerid, 0x33AAFFFF, "[INFO] Você agora pode jogar futebol!");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement