Floats, problems, etc
#1

Well I have this piece of code and it won't work ( that's why I'm posting this lol )

pawn Код:
hook OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    //if(PRESSED(KEY_CTRL_BACK))
    if(newkeys == KEY_CTRL_BACK)
    {
        new Float:Xa, Float:Ya, Float:Za;
        GetVehiclePos(AdminVeh[playerid], Xa, Ya, Za);
        va_print("%f player poz", GetPlayerPos(playerid, X_C, Y_C, Z_C));
        va_print("%f veh poz", GetVehiclePos(AdminVozilo[playerid], Xa, Ya, Za));
        if(!IsPlayerInAnyVehicle(playerid))
        {
            if(!IsPlayerInRangeOfPoint(playerid, 5, Xa, Ya, Za)) return SendClientMessage(playerid, -1, "nonoono");
            else {
                if(Uzo[playerid] == 1) {
                    if(GetVehicleModel(GetClosestVehicle(playerid) != 408)) return SCM(playerid, -1, "nahhh");
                    if(Kontova[playerid] == 15) return SCM(playerid, -1, "PRC");
                    RemovePlayerAttachedObject(playerid, djubr[playerid]);
                    SCM(playerid, -1, "Idite do drugog kontejnera");
                    if(Kontova[playerid] == -1) return Kontova[playerid] = 1;
                    Uzo[playerid] = 0;
                    Kontova[playerid] ++;
                }
            }
        }
    }
    return 1;
}
So va_print prints out "0.00000" for both
PHP код:
if(!IsPlayerInRangeOfPoint(playerid5XaYaZa)) return SendClientMessage(playerid, -1"nonoono"); // this wont work 
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
What do you think GetPlayerPos returns?
U mean like how much floats or ( %f, %f, %f or %f ) ?

[ it returns player's pos ofc xd ]
Reply
#3

https://sampwiki.blast.hk/wiki/GetPlayerPos
https://sampwiki.blast.hk/wiki/GetVehiclePos

Not even close. The position is passed by reference not by return. Only return the succes value
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)