Creating a object at players pos?
#1

Hi!


How can I create a object at a players pos ?

I've tired but I don't know exactly..


pawn Код:
CreatePickup(1212, 4, x, y, z, GetPlayerVirtualWorld(playerid));
Like that ^ but with a object instead...
Reply
#2

Код:
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
CreateObject(1212,x,y,z);
Reply
#3

Quote:
Originally Posted by PDChaseOfficial
Посмотреть сообщение
Код:
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
CreateObject(1212,x,y,z);
Thanks alot! I just forgot the first thing (That above).


Edit when I tired out this before with out help

I got this error:

Код:
C:\Users\Davve\Desktop\Bomb Scirpt.pwn(26) : error 017: undefined symbol "X"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
And I get it now also.

Thanks for help!.
Reply
#4

pawn Код:
new Float:X,Float:Y,Float:Z;
Reply
#5

Thanks alot for help!..

But still problem:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/plant", cmdtext, true, 10) == 0)
    {
        GetPlayerPos(playerid, x, y, z);
        CreateObject(1636, X, Y, Z);
        return 1;
    }
    return 0;
}
Reply
#6

pawn Код:
// Syntax:
CreateObject(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ, Float:DrawDistance);
And "/plant"'s lenght is 6, not 10.
Reply
#7

That with lenght I didn't know!..

Why is that needed ??.. Anyway here's the error forgot to post them:

Код:
C:\Users\Davve\Desktop\Bomb Scirpt.pwn(26) : warning 202: number of arguments does not match definition
C:\Users\Davve\Desktop\Bomb Scirpt.pwn(26) : warning 202: number of arguments does not match definition
C:\Users\Davve\Desktop\Bomb Scirpt.pwn(26) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Warnings.
Reply
#8

It needs atleast 7 parameters(DrawDistance is optional), and you've got 4. You're missing 3 parameters.
pawn Код:
Float:rX, Float:rY, Float:rZ
Reply
#9

Oh I see !, thanks alot!.

Edit: I thought it was lenght of the / how many letter in the / Before LOL!....

But that I knew it needed 7.. But thought wrong...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)