[+rep] Funtion Not Working
#1

Quote:

case CHECKPOINT_RETURNTRUCK:
{
if(TruckDeliveringTo[vehicleid] != INVALID_BUSINESS_ID)
{
new iBusiness = TruckDeliveringTo[vehicleid];
new Float: iDist = GetPlayerDistanceFromPoint(playerid, Businesses[iBusiness][bSupplyPos][0], Businesses[iBusiness][bSupplyPos][1], Businesses[iBusiness][bSupplyPos][2]);

payment = floatround(iDist / 3000 * payment);
if (payment > 25000) payment = 25000;

GivePlayerCash(playerid, payment);
format(string, sizeof(string), "* You were paid $%d for delivering the goods and returning the vehicle.", payment);

SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
SetVehicleToRespawn(vehicleid);
}
}

Compiler it's okey but when im testing in server funtion giveplayercash and Message with String can't work. Only Respawn vehicle, someone can help me pls
Reply
#2

Perhaps you should return the value via return 1;?
Reply
#3

sure im try put return 1; under line SetVehicleToRespawn(vehicleid); but compiler warnning, when remove it, compiler done
Reply
#4

I've never used floatround, but I researched it and I think you're using it wrong.

Try this:
pawn Код:
case CHECKPOINT_RETURNTRUCK:
{
    if(TruckDeliveringTo[vehicleid] != INVALID_BUSINESS_ID)
    {
        new iBusiness = TruckDeliveringTo[vehicleid], iDistex, paymentEx;
        new Float: iDist = GetPlayerDistanceFromPoint(playerid, Businesses[iBusiness][bSupplyPos][0], Businesses[iBusiness][bSupplyPos][1], Businesses[iBusiness][bSupplyPos][2]);

        iDistex = floatround(iDist, floatround_round);
        paymentEx = iDistex / 3000 * payment;
        if (paymentEx > 25000) paymentEx = 25000;

        GivePlayerCash(playerid, paymentEx);
        format(string, sizeof(string), "* You were paid $%d for delivering the goods and returning the vehicle.", paymentEx);

        SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
        SetVehicleToRespawn(vehicleid);
    }
}
Reply
#5

ok im compiting
Reply
#6

Error compiler =="
Reply
#7

Quote:
Originally Posted by ScorpiusMalfoy
Посмотреть сообщение
Error compiler =="
What
Reply
#8

Here is Full Funtion

i don't know why this not working, if im added Ex after payment and compiler became to Error, im changed with new paymentex
Reply
#9

Please show the error to us so we can help you faster.
Reply
#10

all is working only Business funtion not working
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)