Pick up problem
#1

pawn Код:
CMD:pickup(playerid, params[]) // temp
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    AddStaticPickup(1582,1,x,y,z,0);
    printf("AddStaticPickup(1582,1,%d,%d,%d,0);",Float:x,Float:y,Float:z);
    return 1;
}
appears in the logs as..

Код:
[17:22:45] AddStaticPickup(1582,1,-990243889,1124754986,1105710588,0);
[17:23:07] AddStaticPickup(1582,1,-990177427,1124942436,1104957440,0);
How come it's giving me these and not the coordinates that I made the pickup at?
Reply
#2

Use CreatePickup, because it returns a ID

pawn Код:
CMD:pickup(playerid, params[])
{
    new Float:Pos[3];
    GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
    CreatePickup(1582,1,Pos[0],Pos[1],Pos[2],0);
    printf("CreatePickup(1582,1,%d,%d,%d,0);",Float:Pos[0],Float:Pos[1],Float:Pos[2]);
    return 1;
}
Reply
#3

pawn Код:
printf("AddStaticPickup(1582,1,%d,%d,%d,0)",Float:x,Float:y,Float:z);
Reply
#4

Why are you using the %d placeholder when you must use %f?
pawn Код:
CMD:pickup(playerid)
{
    new Float:Pos[3];
    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    CreatePickup(1582, 1, Pos[0], Pos[1], Pos[2], 0);
    printf("CreatePickup(1582, 1, %f, %f, %f, 0);", Float:Pos[0], Float:Pos[1], Float:Pos[2]);
    return 1;
}
Reply
#5

I was wrong, excuse me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)