[+rep] Funtion Not Working - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [+rep] Funtion Not Working (
/showthread.php?tid=526215)
[+rep] Funtion Not Working -
ScorpiusMalfoy - 16.07.2014
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
Re: [+rep] Funtion Not Working -
nmader - 16.07.2014
Perhaps you should return the value via return 1;?
Re: [+rep] Funtion Not Working -
ScorpiusMalfoy - 16.07.2014
sure im try put return 1; under line SetVehicleToRespawn(vehicleid); but compiler warnning, when remove it, compiler done
Re: [+rep] Funtion Not Working -
Jack_Leslie - 16.07.2014
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);
}
}
Re: [+rep] Funtion Not Working -
ScorpiusMalfoy - 16.07.2014
ok im compiting
Re: [+rep] Funtion Not Working -
ScorpiusMalfoy - 16.07.2014
Error compiler =="
Re: [+rep] Funtion Not Working -
Jack_Leslie - 16.07.2014
Quote:
Originally Posted by ScorpiusMalfoy
Error compiler =="
|
What
Re: [+rep] Funtion Not Working -
ScorpiusMalfoy - 16.07.2014
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
Re: [+rep] Funtion Not Working -
Stanford - 16.07.2014
Please show the error to us so we can help you faster.
Re: [+rep] Funtion Not Working -
ScorpiusMalfoy - 16.07.2014
all is working only Business funtion not working