GetPlayerVelocity ?
#1

Hi everyone. how can i make that you earn money from how much you drive,
instead of a timer? i hope you can help me

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 574)
        {
            stimer = SetTimerEx("Sweeping", WAIT_TIME, true, "d", playerid);
            SendClientMessage(playerid, 0x58E11EC8, "You are now Street Sweeping to earn money. Drive around and earn money!");
        }
       
    }
    return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(GetVehicleModel(vehicleid) == 574)
    {
        KillTimer(stimer);
        SendClientMessage(playerid, 0x58E11EC8, "You are no longer doing your Street Sweeping Job!");
    }
    return 1;
}


forward Sweeping(playerid);
public Sweeping(playerid)
{
    new string[128];
    new rand = 200 + random(210);
    GivePlayerMoney(playerid, rand);
    format(string, sizeof(string), "You have received $%d for your Street Sweeping Job!", rand);
    SendClientMessage(playerid, 0x58E11EC8, string);
    return 1;
}
Reply


Messages In This Thread
GetPlayerVelocity ? - by MayaEU - 16.06.2016, 20:01
Re: GetPlayerVelocity ? - by MayaEU - 16.06.2016, 20:15
Re: GetPlayerVelocity ? - by WhiteGhost - 16.06.2016, 20:16
Re: GetPlayerVelocity ? - by MayaEU - 16.06.2016, 20:18
Re: GetPlayerVelocity ? - by Stinged - 16.06.2016, 20:36
Re: GetPlayerVelocity ? - by MayaEU - 16.06.2016, 20:39
Re: GetPlayerVelocity ? - by MayaEU - 16.06.2016, 21:40
Re: GetPlayerVelocity ? - by d1git - 17.06.2016, 01:55
Re: GetPlayerVelocity ? - by MayaEU - 17.06.2016, 04:50
Re: GetPlayerVelocity ? - by d1git - 17.06.2016, 13:39

Forum Jump:


Users browsing this thread: 2 Guest(s)