[FilterScript] Hooker job
#1

About the job
Job is created with the name "hooker". You can become a whore and have sex with other people if they want so. You have to pay $200 to have sex with the whore. The commands for hookers are /hooker which can make you a hooker. As for other players they have to /sex with you in order to get paid. You can become hooker at any place since it depends on you where to set it. Your player color becomes PINK so other players can recognise that you are a hooker.


What you need
You will need the filterscript and the include utils.


How to install
You will need to have both files (filterscirpt and utils include) to procced. Open "Filterscripts" folder in your server's folder and input it there. Then open your server.cfg file and include in the "filtersciprt" line.

Example:
echo Executing Server Config...
lanmode 0
rcon_password changeme
maxplayers 32
port 7777
hostname SA-MP 0.3 Server
gamemode0 lvdm 1
filterscripts hookerjob
announce 1
query 1
weburl www.sa-mp.com
onfoot_rate 40
incar_rate 40
weapon_rate 40
stream_distance 300.0
stream_rate 1000
maxnpc 0
logtimeformat [%H:%M:%S]

Pawn code

pawn Код:
// Hooker job by Modiano.

#include <a_samp>
#include <utils>

#define COLOR_PINK 0xFF66FFAA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_GROVE 0x00FF00FF
#define COLOR_CREAM 0xFF8282AA


main()
{
    print("\n----------------------------------");
    print("Hooker job system by Modiano.");
    print("----------------------------------\n");
}

strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}

forward ProxDetectorS(Float:radi, playerid, targetid);

enum pInfo
{
    pJobNumber,
    pHookerDuty
};
new PlayerInfo[MAX_PLAYERS][pInfo];

public OnPlayerConnect(playerid)
{
    PlayerInfo[playerid][pJobNumber] = 0;
    PlayerInfo[playerid][pHookerDuty] = 0;
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    new sender[MAX_PLAYER_NAME];
    new giveplayer[MAX_PLAYER_NAME];
    new giveplayerid;
    new string[512 char];
    new tmp[128];
    new idx = 184;
   
    new hooker;
    hooker = PlayerInfo[playerid][pJobNumber] = 10;// change the job id if you want
   
    if(strcmp("/hooker", cmdtext, true, 10) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pJobNumber] == 0)
            {
                if(PlayerInfo[playerid][pHookerDuty] == 0)
                {
                    PlayerInfo[playerid][pJobNumber] = hooker;
                    PlayerInfo[playerid][pHookerDuty] = 1;
                    SetPlayerColor(playerid, COLOR_PINK);
                    SetPlayerSkin(playerid, 152);
                    SendClientMessage(playerid, COLOR_GROVE, "You are now on hooker duty.");
                    return 1;
                }
                else
                {
                    PlayerInfo[playerid][pJobNumber] = 0;
                    PlayerInfo[playerid][pHookerDuty] = 0;
                    SetPlayerSkin(playerid, 101);
                    SetPlayerColor(playerid, COLOR_WHITE);
                    SendClientMessage(playerid, COLOR_CREAM, "You are now off hooker duty.");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_CREAM, "You already have a job. Type /quitjob to quit your current job.");
                return 1;
            }
        }
    }
   
    if(strcmp("/sex", cmdtext, true, 10) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pJobNumber] == 0)
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_CREAM, "/sex [playerid]");
                    SendClientMessage(playerid, COLOR_CREAM, "Sex price is: $200");
                    return 1;
                }
                giveplayerid = ReturnUser(tmp);
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        if (ProxDetectorS(8.0, playerid, giveplayerid))
                        {
                            if(giveplayerid == playerid)
                            {
                                SendClientMessage(playerid, COLOR_CREAM, "If you want to sex with yourself go buy a dildo.");
                                return 1;
                            }
                            if(PlayerInfo[giveplayerid][pJobNumber] == hooker)
                            {
                                GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

                                format(string, sizeof(string), "You had sex with %s for $200.", giveplayer);
                                SendClientMessage(playerid, COLOR_WHITE, string);
                                format(string, sizeof(string), "You had sex with %s for $200.", sender);
                                SendClientMessage(giveplayerid, COLOR_WHITE, string);
                            }
                            else
                            {
                                SendClientMessage(playerid, COLOR_CREAM, "Player is not a hooker.");
                                return 1;
                            }
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_CREAM, "DO you have it that big?");
                            return 1;
                        }
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_CREAM, "Player offline.");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_CREAM, "You cannot have sex while you have a job.");
                return 1;
            }
        }
    }
    return 0;
}

public ProxDetectorS(Float:radi, playerid, targetid)
{
    if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
    {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        GetPlayerPos(targetid, posx, posy, posz);
        tempposx = (oldposx -posx);
        tempposy = (oldposy -posy);
        tempposz = (oldposz -posz);
        if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
        {
            return 1;
        }
    }
    return 0;
}
Overall downloads
Filterscript - solidfiles
- mediafire

Utils include - solidfiles
- mediafire

Important notice
After downloading the filterscript and the include you will need to COMPILE the filterscript and put the INCLUDE in "Includes" folder in pawno folder.

__________________________________________________ __________________________________________
Reply
#2

simple, but GJ.
Reply
#3

Thanks trying to do as much as I can...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)