SA-MP Forums Archive
SREET CLEANER FILTERSCRIPT HELP(AWARDS GIVEN) - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SREET CLEANER FILTERSCRIPT HELP(AWARDS GIVEN) (/showthread.php?tid=169030)



SREET CLEANER FILTERSCRIPT HELP(AWARDS GIVEN) - michaelw352 - 18.08.2010

THIS CASE HAS BEEN SOLVED THANKS TO THE HELP OF POTH3AD,THANK YOU!THIS CASE IS NOW CLOSED AND CAN BE LOCKED BY A MOD OR ADMIN!!!



Awards:




Re: SREET CLEANER FILTERSCRIPT HELP(AWARDS GIVEN) - [L3th4l] - 18.08.2010

lol, you also want a full gamemode? man, give it a daem try!


Re: SREET CLEANER FILTERSCRIPT HELP(AWARDS GIVEN) - PotH3Ad - 18.08.2010

Script Request Thread: https://sampforum.blast.hk/showthread.php?tid=118885&page=145

No U, Hitman


Re: SREET CLEANER FILTERSCRIPT HELP(AWARDS GIVEN) - michaelw352 - 18.08.2010

I`m not using gamemodes,I want my server unique L3


Re: SREET CLEANER FILTERSCRIPT HELP(AWARDS GIVEN) - michaelw352 - 18.08.2010

Please leave your replies!


Re: SREET CLEANER FILTERSCRIPT HELP(AWARDS GIVEN) - Toni - 18.08.2010

You should start trying to create your own scripts. Or at least learn the very basics of PAWN.
Or else you're gonna have a script created by random scripts that weren't made by you.


Re: SREET CLEANER FILTERSCRIPT HELP(AWARDS GIVEN) - michaelw352 - 18.08.2010

I do make scripts you idiot,im just asking for help on some things!


Re: SREET CLEANER FILTERSCRIPT HELP(AWARDS GIVEN) - michaelw352 - 18.08.2010

I just need help on some things im making because I made a GameMode with my scripts so shutup!


Re: SREET CLEANER FILTERSCRIPT HELP(AWARDS GIVEN) - PotH3Ad - 18.08.2010

Here you go, let me know if their is anything wrong since I made it in a hurry :P

You should learn to script, I had to learn the hard way since no one would help me when I would ask them to teach me :P

pawn Код:
#include <a_samp>
#include <zcmd>

#define NOTMOVING_VELO 0.000001 //Not Moving Velocity

new CleanMission[MAX_PLAYERS];
new MovingCheck[MAX_PLAYERS];

stock IsPlayerDrivingVehicle(playerid)
{
    new Float:Velo[3];
    GetVehicleVelocity(GetPlayerVehicleID(playerid), Velo[0], Velo[1], Velo[2]);
    if(Velo[0] < NOTMOVING_VELO && Velo[1] < NOTMOVING_VELO && Velo[2] < NOTMOVING_VELO) return 0;
    return 1;
}

CMD:accept(playerid, params[])
{
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 574) return SendClientMessage(playerid, 0xFAFAFAFA, "You must be in a Street Cleaning Vehicle!");
    else if(GetPVarInt(playerid, "StreetClean") == 1) return SendClientMessage(playerid, 0xFAFAFAFA, "Exit the vehicle to quit the mission!");

    TogglePlayerControllable(playerid, 1);
    SendClientMessage(playerid, 0xFAFAFAFA, "You accepted the street cleaning mission!");
    SendClientMessage(playerid, 0xFAFAFAFA, "You must clean the roads for 2 minutes!");
    SetPVarInt(playerid, "MoveWarns", 0);

    CleanMission[playerid] = SetTimerEx("StreetCleanFinish", 120000, 0, "d", playerid);
    MovingCheck[playerid] = SetTimerEx("DrivingCheck", 2000, 1, "d", playerid);
    return 1;
}

CMD:decline(playerid, params[])
{
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 574) return SendClientMessage(playerid, 0xFAFAFAFA, "You must be in a Street Cleaning Vehicle!");
    else if(GetPVarInt(playerid, "StreetClean") == 1) return SendClientMessage(playerid, 0xFAFAFAFA, "Exit the vehicle to quit the mission!");

    RemovePlayerFromVehicle(playerid);
    TogglePlayerControllable(playerid, 1);
    SendClientMessage(playerid, 0xFAFAFAFA, "You declined the street cleaning mission!");
    return 1;
}

public OnPlayerConnect(playerid)
{
    SetPVarInt(playerid, "StreetClean", 0);
    return 1;
}

public OnPlayerDisconnect(playerid)
{
    KillTimer(MovingCheck[playerid]);
    KillTimer(CleanMission[playerid]);
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER && GetPVarInt(playerid, "StreetClean") == 0)
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 574)
        {
            SendClientMessage(playerid, 0xFAFAFAFA, "Type /accept or /decline to start/exit the mission.");
            TogglePlayerControllable(playerid, 0);
            return 1;
        }
    }
    else if(newstate == PLAYER_STATE_ONFOOT && GetPVarInt(playerid, "StreetClean") == 1)
    {
        SendClientMessage(playerid, 0xFAFAFAFA, "You have left your Street Cleaning Job and earned $0!");
        TogglePlayerControllable(playerid, 1);
        KillTimer(CleanMission[playerid]);
        return 1;
    }
    return 1;
}

forward StreetCleanFinish(playerid);
public StreetCleanFinish(playerid)
{
    KillTimer(CleanMission[playerid]);
    KillTimer(MovingCheck[playerid]);
    SendClientMessage(playerid, 0xFAFAFAFA, "You successfully completed the Street Cleaning Mission!");
    SendClientMessage(playerid, 0xFAFAFAFA, "You have earned $70!");
    GivePlayerMoney(playerid, 70);
    SetPVarInt(playerid, "MoveWarns", 0);
    return 1;
}

forward DrivingCheck(playerid);
public DrivingCheck(playerid)
{
    if(IsPlayerDrivingVehicle(playerid)) return 1;

    new str[100];
    SetPVarInt(playerid, "MoveWarns", GetPVarInt(playerid, "MoveWarns")+1);
    format(str, sizeof(str), "Get your vehicle moving or the mission will end! (Warn: %d/3)", GetPVarInt(playerid, "MoveWarns"));
    SendClientMessage(playerid, 0xFAFAFAFA, str);
   
    if(GetPVarInt(playerid, "MoveWarns") > 3)
    {
        KillTimer(CleanMission[playerid]);
        KillTimer(MovingCheck[playerid]);
        SendClientMessage(playerid, 0xFAFAFAFA, "Mission Ended, you failed to keep your vehicle moving!");
        SendClientMessage(playerid, 0xFAFAFAFA, "You have left your Street Cleaning Job and earned $0!");
        SetPVarInt(playerid, "MoveWarns", 0);
        SetPVarInt(playerid, "StreetClean", 0);
    }
    return 1;
}



Re: SREET CLEANER FILTERSCRIPT HELP(AWARDS GIVEN) - michaelw352 - 18.08.2010

CASE SOLVED AND ADMINISTRATOR OR MODERATOR MAY CLOSE OR LOCK THE TOPIC,THANKS FOR ALL THE HELP POTH3AD!