Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <FCNPC>
- main(){}
- new npc_car;
- public OnGameModeInit()
- {
- AddPlayerClass(0, 1954.0790, -2451.3960, 13.5391, 7.6344, 0, 0, 0, 0, 0, 0);
- npc_car = CreateVehicle(542, 1960.1898, -2489.5659, 13.5391, 87.2660, 130, 138, -1);
- return 1;
- }
- new my_npc, npc_pickup;
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (!strcmp("/npc", cmdtext, true))
- {
- my_npc = FCNPC_Create("Josh");
- FCNPC_Spawn(my_npc, 104, 1953.6671, -2444.9656, 13.5391);
- FCNPC_SetAngle(my_npc, 185.6094);
- FCNPC_PutInVehicle(my_npc, npc_car, 0);
- return 1;
- }
- if (!strcmp("/gethim", cmdtext, true))
- {
- DestroyPickup(npc_pickup);
- new Float:x, Float:y, Float:z, Float:angle;
- GetPlayerPos(playerid, x, y, z);
- GetPlayerFacingAngle(playerid, angle);
- x += (6.0 * floatsin(-angle, degrees));
- y += (6.0 * floatcos(-angle, degrees));
- FCNPC_SetPosition(my_npc, x, y, z);
- FCNPC_SetAngle(my_npc, angle);
- npc_pickup = CreatePickup(2998, 1, x, y, z, -1);
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment