Put an object on players location
#1

Hello I want to make a command when player types /house a house will appear next to him. I use CMD.
Reply
#2

This is not a script request place, but however I can give you some tips.

Get the house object ID you want to make it appear, then define x,y,z with

pawn Код:
new Float:x,Float:y,Float:z
Then, get the Player's Pos by GetPlayerPos, then create the object on player's coordinates, search wiki for usage of the functions.

These are the URLs:

https://sampwiki.blast.hk/wiki/GetPlayerPos
https://sampwiki.blast.hk/wiki/CreateObject
https://sampwiki.blast.hk/wiki/Floats
https://sampwiki.blast.hk/wiki/Model_ID

Dont forget the put a + to player's pos while creating the object our player might end up getting stuck in the house.
Reply
#3

Код:
CMD:house(playerid,params[])
{
 new Float:x,Float:y,Float:z;
 GetPlayerPos(playerid,x,y,z);
 CreateObject(19499, x+10, y+10, z+0.1, 0.0, 0.0, 96.0,250.0);
 return 1;
}
Reply
#4

Thank you Rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)