[HELP] Random money between 50k-100k
#1

How can i rob the SexShop random money form 50k-100k

"You have robbed 78558(random) from the sex shop" //After you have robbed, you need to wait 5 min to rob again
"The sex shop have recendly been robbed"

I came so far:
pawn Код:
#include <a_samp>

#define FILTERSCRIPT

#define COLOR_DARKRED 0xAA3333AA

#pragma tabsize 0;

//Checkpoints
new EnterSexShop, ExitSexShop, RobSexShop;


public OnFilterScriptInit()
{

    //Checkpoints
    EnterSexShop = CreatePickup(1273, 23, 2094.7260742188,2122.6782226563,9.7453060150146); //EnterSexShop
    ExitSexShop = CreatePickup(1273, 23, -204.33526611328,-27.19874382019,1001.2746582031); //ExitSexShop
    RobSexShop = CreatePickup(1273, 23, -204.33526611328,-27.19874382019,1001.2746582031); //ExitSexShop

    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
//EnterSexShop~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    if( pickupid == EnterSexShop){
            SetPlayerPos(playerid,2094.7260742188,2120.6782226563,9.7453060150146);
            SetPlayerInterior(playerid,  16 );
            SendClientMessage(playerid,COLOR_DARKRED,"Welcome to the Sex Shop!");
        }
//ExitSexShop~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   if( pickupid == ExitSexShop){
        SetPlayerPos(playerid,-204.33526611328,-27.19874382019,1001.2746582031);
        SetPlayerInterior(playerid,  0 );
        SendClientMessage(playerid,COLOR_DARKRED,"You have left the Sex Shop!");
        }
//RobSexShop~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    if( pickupid == RobSexShop){
            SendClientMessage(playerid,COLOR_DARKRED,"/robsex to rob the Sex Shop");
            GivePlayerWeapon(playerid, 4, 1); //Pink Dildo :P
        }
    return 0;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/robsex", cmdtext, true, 10) == 0)
    {
        GivePlayerMoney(playerid, +50000);
        }
        return else
        }
        SendClientMessage(playerid,COLOR_DARKRED,"The sex shop have recendly been robbed!");
}
    return 0;
}
ERROR:
pawn Код:
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\LVRob.pwn(50) : error 029: invalid expression, assumed zero
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\LVRob.pwn(50) : warning 215: expression has no effect
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\LVRob.pwn(50) : error 001: expected token: ";", but found ")"
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\LVRob.pwn(50) : error 029: invalid expression, assumed zero
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\LVRob.pwn(50) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
I have searched on Wiki and on forum, but i dont find anything.
Reply
#2

Any Ideas
Reply
#3

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/robsex", cmdtext, true, 10) == 0)
    {
        new rand = random(50000)+45000;
        GivePlayerMoney(playerid, rand);
        }
        else
        }
        SendClientMessage(playerid,COLOR_DARKRED,"The sex shop have recendly been robbed!");
}
    return 0;
}
Reply
#4

Thx but 1 ERROR & And how do you do so i need to wait 5 minutes before rob again?

pawn Код:
#include <a_samp>

#define FILTERSCRIPT

#define COLOR_DARKRED 0xAA3333AA

#pragma tabsize 0;

//Checkpoints
new EnterSexShop, ExitSexShop, RobSexShop;


public OnFilterScriptInit()
{

    //Checkpoints
    EnterSexShop = CreatePickup(1273, 23, 2094.7260742188,2122.6782226563,9.7453060150146); //EnterSexShop
    ExitSexShop = CreatePickup(1273, 23, -204.33526611328,-27.19874382019,1001.2746582031); //ExitSexShop
    RobSexShop = CreatePickup(1273, 23, -204.33526611328,-27.19874382019,1001.2746582031); //ExitSexShop

    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
//EnterSexShop~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    if( pickupid == EnterSexShop){
            SetPlayerPos(playerid,2094.7260742188,2120.6782226563,9.7453060150146);
            SetPlayerInterior(playerid,  16 );
            SendClientMessage(playerid,COLOR_DARKRED,"Welcome to the Sex Shop!");
        }
//ExitSexShop~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   if( pickupid == ExitSexShop){
        SetPlayerPos(playerid,-204.33526611328,-27.19874382019,1001.2746582031);
        SetPlayerInterior(playerid,  0 );
        SendClientMessage(playerid,COLOR_DARKRED,"You have left the Sex Shop!");
        }
//RobSexShop~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    if( pickupid == RobSexShop){
            SendClientMessage(playerid,COLOR_DARKRED,"/robsex to rob the Sex Shop");
            GivePlayerWeapon(playerid, 4, 1); //Pink Dildo :P
        }
    return 0;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/robsex", cmdtext, true, 10) == 0)
    {
        new rand = random(50000)+45000;
        GivePlayerMoney(playerid, rand);
        }
        else
        }
        SendClientMessage(playerid,COLOR_DARKRED,"The sex shop have recendly been robbed!");
    return 1;
    }
ERROR: (How to fix.)
pawn Код:
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\LVcheckpoints.pwn(54) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#5

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/robsex", cmdtext, true, 10) == 0)
    {
        new rand = random(50000)+45000;
        GivePlayerMoney(playerid, rand);
    SetTimer("Sex",300000,true);
        }
        else
        }
        SendClientMessage(playerid,COLOR_DARKRED,"The sex shop have recendly been robbed!");
    return 1;
    }

forward Sex(playerid);
public Sex(playerid)
{
    SendClientMessage(playerid,COLOR_DARKRED,"SHOP IS ALREADY ROBED");
    //blah //blah whatever else u want to feature for this
Reply
#6

Quote:
Originally Posted by Kitten
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/robsex", cmdtext, true, 10) == 0)
    {
        new rand = random(50000)+45000;
        GivePlayerMoney(playerid, rand);
    SetTimer("Sex",300000,true);
        }
        else
        }
        SendClientMessage(playerid,COLOR_DARKRED,"The sex shop have recendly been robbed!");
    return 1;
    }

forward Sex(playerid);
public Sex(playerid)
{
    SendClientMessage(playerid,COLOR_DARKRED,"SHOP IS ALREADY ROBED");
    //blah //blah whatever else u want to feature for this
That dont work very well, I can rob the sex shop like 50 times and then this text come up "The sex shop have recendly been robbed!" After that i can keep robbing
Reply
#7

I want it to work on same way in this video: [ame="http://www.youtube.com/watch?v=diWtKnc68GY"]VIDEO[/ame]

1. Enter checkpoint then "Type /robsex to rob the sex shop"
2. Then Type "/robsex"
3. Then "Robbery complete, You robbed (Random money) from the sex shop"
4. (PlayerName + How much he/she robbed) sould show up si evryone can see it like "[Lvrcr]Larsey123(3) has robbed (random money) from the sex shop"


The scipt look like this now:
pawn Код:
#include <a_samp>

#define FILTERSCRIPT

#define COLOR_DARKRED 0xAA3333AA

#pragma tabsize 0;

//Checkpoints
new RobSexShop;
//Forwards
forward Sex(playerid);


public OnFilterScriptInit()
{

    //Checkpoints
    RobSexShop = CreatePickup(1273, 23, -103.82875823975,-22.51379776001,999.71875); //ExitSexShop
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
//RobSexShop~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    if( pickupid == RobSexShop){
            SendClientMessage(playerid,COLOR_DARKRED,"/robsex to rob the Sex Shop");
        }
    return 0;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/robsex", cmdtext, true, 10) == 0)
    {
        SetTimer("Sex",300000,true);
        new rand = random(50000)+45000;
        GivePlayerMoney(playerid, rand);
        new weprand = random(1)+0;
        GivePlayerWeapon(playerid, weprand, 150);
        }
    return 1;
    }

public Sex(playerid)
{
    SendClientMessage(playerid,COLOR_DARKRED,"The Sex Shop has redencly been robbed!!!");

    return 1;
}
Reply
#8

Maybe something liks this:
pawn Код:
#include <a_samp>
#define COLOR_DARKRED 0xAA3333AA

new
    gRobbed[MAX_PLAYERS];

//Checkpoints
new RobSexShop;
//Forwards
forward Sex(playerid);
forward RobTimer(playerid);

public OnFilterScriptInit()
{
    //Checkpoints
    RobSexShop = CreatePickup(1273, 23, -103.82875823975,-22.51379776001,999.71875); //ExitSexShop
   
    SetTimer("RobTimer", 1000, 1);
    return 1;
}
public OnFilterScriptExit()
{
    return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
    //RobSexShop~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    if( pickupid == RobSexShop) {
        SendClientMessage(playerid,COLOR_DARKRED,"/robsex to rob the Sex Shop");
    }
    return 0;
}
public OnPlayerConnect(playerid)
{
    gRobbed[playerid] = 0;
    return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp(cmdtext, "/robsex", true))
    {
        new
            moneyrand = random(50000)+45000,
            weprand = random(1)+0
        ;
        if(gRobbed[playerid] != 0) return SendClientMessage(playerid, COLOR_DARKRED, "The Sex Shop has redencly been robbed!!!");
        GivePlayerMoney(playerid, moneyrand);
        GivePlayerWeapon(playerid, weprand, 150);
        gRobbed[playerid] = 300;
        return 1;
    }
    return 0;
}
public RobTimer(playerid)
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(gRobbed[i] > 0)
            {
                gRobbed[i]--;
            }
        }
    }
    return 1;
}
Reply
#9

Quote:
Originally Posted by mmrk
Посмотреть сообщение
Maybe something liks this:
pawn Код:
#include <a_samp>
#define COLOR_DARKRED 0xAA3333AA

new
    gRobbed[MAX_PLAYERS];

//Checkpoints
new RobSexShop;
//Forwards
forward Sex(playerid);
forward RobTimer(playerid);

public OnFilterScriptInit()
{
    //Checkpoints
    RobSexShop = CreatePickup(1273, 23, -103.82875823975,-22.51379776001,999.71875); //ExitSexShop
   
    SetTimer("RobTimer", 1000, 1);
    return 1;
}
public OnFilterScriptExit()
{
    return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
    //RobSexShop~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    if( pickupid == RobSexShop) {
        SendClientMessage(playerid,COLOR_DARKRED,"/robsex to rob the Sex Shop");
    }
    return 0;
}
public OnPlayerConnect(playerid)
{
    gRobbed[playerid] = 0;
    return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp(cmdtext, "/robsex", true))
    {
        new
            moneyrand = random(50000)+45000,
            weprand = random(1)+0
        ;
        if(gRobbed[playerid] != 0) return SendClientMessage(playerid, COLOR_DARKRED, "The Sex Shop has redencly been robbed!!!");
        GivePlayerMoney(playerid, moneyrand);
        GivePlayerWeapon(playerid, weprand, 150);
        gRobbed[playerid] = 300;
        return 1;
    }
    return 0;
}
public RobTimer(playerid)
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(gRobbed[i] > 0)
            {
                gRobbed[i]--;
            }
        }
    }
    return 1;
}
Thanks, that work
Reply
#10

But how do you make text who show how much he robbed?

pawn Код:
GameTextForPlayer(playerid,"~W~Robbery ~B~Complete ~N~You robbed ~N~($RandomMONEY) ~N~ from the sex shop",5000,5);
pawn Код:
And a text who evryone can see how much he robbed =/
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)