Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <omp_npc>
- 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 = NPC_Create("Josh");
- NPC_Spawn(my_npc);
- NPC_SetSkin(my_npc, 104);
- NPC_SetPos(my_npc, 1953.6671, -2444.9656, 13.5391);
- NPC_SetFacingAngle(my_npc, 185.6094);
- NPC_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));
- NPC_SetPos(my_npc, x, y, z);
- NPC_SetFacingAngle(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