Mind helping me? (Pro scripter) nevermind..
#1

Hey guys.
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE))
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new currentveh;
            currentveh = GetPlayerVehicleID(playerid);
            new Float:vehx, Float:vehy, Float:vehz,Float:vehz_rot;
            GetVehiclePos(currentveh, vehx, vehy, vehz);
            CreateObject(18648,vehx , vehy, vehz, vehz_rot);
        }
    }
    return 1;
}
How can i create object id 18648 infront of player a little bit?
pawn Код:
CreateObject(18648,vehx , vehy, vehz, vehz_rot);
PS: I want to learn about Moving objects fast infront.
I guess it's Floatcos and Floatsin?
Thanks
Reply
#2

No, GetXYInFrontOfPlayer
Reply
#3

pawn Код:
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
    new Float:a;
    GetPlayerPos(playerid, x, y, a);
    GetPlayerFacingAngle(playerid, a);
    if (GetPlayerVehicleID(playerid))
    {
      GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    }
    x += (distance * floatsin(-a, degrees));
    y += (distance * floatcos(-a, degrees));
}
How can this help me? in Moving the object fast or getting the cords?
Sorry new to this shit and it's night (mind fucked i guess so).
will this help me get the infront pos of player?
Reply
#4

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE))
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new currentveh;
            currentveh = GetPlayerVehicleID(playerid);
            new Float:vehx, Float:vehy, Float:vehz,Float:vehz_rot;
            GetXYInFrontOfPlayer(playerid,vehx,vehy,5);
            CreateObject(18648,vehx , vehy, vehz, vehz_rot);
        }
    }
    return 1;
}
And put that GetXYInFrontOfPlayer at the end of your whole script
Reply
#5

pawn Код:
CreateObject(18648,vehx , vehy, vehz, vehz_rot);
pawn Код:
CreateObject(modelif,X,Y,Z,rX,rY,rZ,Float:DrawDistance = 0.0)
Код:
C:\Users\Warkadang\Desktop\Scripting\Scripting\gamemodes\Derby.pwn(201) : warning 202: number of arguments does not match definition
C:\Users\Warkadang\Desktop\Scripting\Scripting\gamemodes\Derby.pwn(201) : warning 202: number of arguments does not match definition
C:\Users\Warkadang\Desktop\Scripting\Scripting\gamemodes\Derby.pwn(198) : warning 204: symbol is assigned a value that is never used: "currentveh"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

Header size:           1568 bytes
Code size:             2756 bytes
Data size:              520 bytes
Stack/heap size:      16384 bytes; estimated max. usage=28 cells (112 bytes)
Total requirements:   21228 bytes

3 Warnings.
Ehm...
Does it matter? i guess so
I know it'll be fixed after removing the veh_rotz, but i guess that is needed.
Reply
#6

It does not matter,I also have a script having these warnings but they work fine.
Reply
#7

Quote:
Originally Posted by TaLhA XIV
Посмотреть сообщение
It does not matter,I also have a script having these warnings but they work fine.
No its not alright, they are there for some reason, they should not be ignored.
It means you're not putting in some information.
Try putting ,0,0,0 after the vehz_rot
Reply
#8

Fixed. but after removing currentveh
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE))
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new Float:vehx, Float:vehy, Float:vehz,Float:vehz_rot;
            GetXYInFrontOfPlayer(playerid,vehx,vehy,5);
            CreateObject(18648,vehx , vehy, vehz, vehz_rot,0,0,0);
        }
    }
    return 1;
}
PS: still looking for help floatsin and floatcos to speed move the object, darn it's 3:10 AM.
Reply
#9

Even a tutorial to floatsin and floatcos would help.
Reply
#10

And a tutorial on "How to not double post"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)