Little Help
#1

Hello everybody I want to create simple granade launcher..But object does not appears I don`t know why here is code
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    if(GranadeLaucher[playerid] == 1)
    {
        new Float:X,Float:Y,Float:Z;
        Object1 = CreateObject(342, X,Y,Z, 0, 0, 180);//toto nacim on player shoot
        CreateExplosion(fX, fY, fZ, 3, 15.0);
        GetPlayerLastShotVectors(playerid, X, Y, Z, fX, fY, fZ);
        MoveObject(Object1,fX,fY,fZ,1.0,0,0,0);
    }
    return 1;
}
Can you check?
Reply
#2

the createobject line has x y and z which have not been assigned any value thats why object is not creating
and also it should give a warning that x y and z has not assigned a value while compiling
Reply
#3

pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    if(GranadeLaucher[playerid] == 1)
    {
        new Float:X,Float:Y,Float:Z;
        GetPlayerPos(playerid,X,Y,Z);//forgot this? :P
        Object1 = CreateObject(342, X,Y,Z, 0, 0, 180);//toto nacim on player shoot
        CreateExplosion(fX, fY, fZ, 3, 15.0);
        GetPlayerLastShotVectors(playerid, X, Y, Z, fX, fY, fZ);
        MoveObject(Object1,fX,fY,fZ,1.0,0,0,0);
    }
    return 1;
}
@ BroZeus

They would be set as 0.0 :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)