10.09.2011, 16:28
(
Последний раз редактировалось knackworst; 10.09.2011 в 20:11.
)
I made for the speedcam thing, something that gives you a ticket, you can either pay the ticket or don't pay the ticket.
look:
and
well, how can I use the amount of money used under OnPlayerUpdate, and use it in my OnDialogResponse?
I need the finalspeed_int*2 amount, to be able to use anywhere in my GM :/
look:
pawn Код:
for(new i; i != sizeof gObjects90; ++i) {
if(IsPlayerInRangeOfPoint(playerid, 25.0, gObjects90[i][0], gObjects90[i][1], gObjects90[i][2])) {
if(IsFlashed[playerid] == 0)
{
new Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,speed_string[300],final_speed_int,speed_string2[300];
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
SendClientMessage(playerid,COLOR_RED, " ");
GetVehicleVelocity(vehicleid,speed_x,speed_y,speed_z);
final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*136.666667;
final_speed_int = floatround(final_speed,floatround_round);
format(speed_string,300,"* U were driving {FF6347}%i{FF0000}, while U were only allowed to drive {FF6347}90{FF0000}KPH, For that U must pay: ${FF6347}%i{FF0000}",final_speed_int, final_speed_int*2);
//format(string,sizeof(string),"U were driving %i, while U were only allowed to drive 90KPH, For that U lost: %i bucks",vehspeed,vehspeed*2);
SendClientMessage(playerid,COLOR_RED, speed_string);
GameTextForPlayer(playerid,"~r~B~y~U~b~S~g~T~w~E~p~D",5000,3);
//Dialog om te betalen
format(speed_string2,300,"{FFFFFF}U must pay: ${FF6347}%i{FFFFFF}\nBecause You were Driving {FF6347}%i{FFFFFF}Faster than allowed!\n\nIf you don't pay, U will becoma a suspect!",final_speed_int*2,final_speed_int-90);
ShowPlayerDialog(playerid,DIALOG_PAYME,DIALOG_STYLE_MSGBOX,"Speed Cam",speed_string2,"Pay","Fuck off!");
camflash(playerid);
SetTimerEx("resflashed",3000,false,"i",playerid);
IsFlashed[playerid] = 1;
}
}
}
pawn Код:
//==============================================================================
//Pay ticket when flashed
//==============================================================================
if(dialogid == DIALOG_PAYME)
{
if(!response)
{
//Will make that later
}
else
{
//here I need the pay ticket stuff
}
}
I need the finalspeed_int*2 amount, to be able to use anywhere in my GM :/