SREET CLEANER FILTERSCRIPT HELP(AWARDS GIVEN)
#1

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:

Reply
#2

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

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

No U, Hitman
Reply
#4

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

Please leave your replies!
Reply
#6

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.
Reply
#7

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

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

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;
}
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)