Rob system - Help
#1

Someone help me out please cause I have some rrors that i can't solve, if you can help me out i would appricete it

Errors:

pawn Код:
Line 93: error 017: undefined symbol "ROB"
Line 93: error 017: undefined symbol "INFO"
Line 102: error 017: undefined symbol "pInfo"
Line 102: warning 215: expression has no effect
Line 102: error 001: expected token: ";", but found "]"
Line 102: error 029: invalid expression, assumed zero
Line 102: fatal error 107: too many error messages on one line
Lines of errors:

Line 93: SendClientMessage( playerid, INFO, szStr );
Line 102: pInfo[ playerid ][ Robskill ] ++;


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

forward robPizza( playerid ); //Add this to the top of your script under your includes!

new
        robTimerP[ MAX_PLAYERS ],
        cp_Pizza,
        bool: pRobbingP[ MAX_PLAYERS ],
        bool: pizzaRobbed;


public OnFilterScriptInit()
{
    cp_Pizza = CreateDynamicCP( 378.2259, -114.4946, 1001.4922, 2.0, .interiorid = 5);
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerEnterDynamicCP( playerid, checkpointid )
{
    if( pRobbingP[ playerid ] )
    {
            if ( checkpointid == cp_Pizza )
            {
                pRobbingP[ playerid ] = false;
                KillTimer( robTimerP[ playerid ] );
                pizzaRobbed = false;
                GameTextForPlayer( playerid, "~r~You have failed the robbery!", 1000, 3 );
            }
    }
    return true;
}

//IDLEWOOD PIZZA

CMD:robpizza( playerid, params[ ] )
{

        if ( pRobbingP[ playerid ] )
                return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} You are already robbing Idlewood Pizza" );

        if ( !IsPlayerInRangeOfPoint( playerid, 3.0, 378.2259, -114.4946, 1001.4922 ) )
            return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} You must be in the checkpoint at Idlewood Pizza to use this command!" );

        if ( pizzaRobbed )
            return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} Idlewood Pizza has been robbed recently, please wait patiently!" );

        robTimerP[ playerid ] = SetTimerEx( "robPizza", 30000, false, "i", playerid );

        SendClientMessage( playerid, INFO, "[ROBBERY INFO] You have started a robbery, it will last 30 seconds. Do not leave the checkpoint!" );

        pRobbingP[ playerid ] = true;
        pizzaRobbed = true;

        new
            szStr[ 128 ],
            usrName[ 24 ];

        GetPlayerName( playerid, usrName, 24 );
        format( szStr, 128, "[ROBBERY] %s has began a robbery at Idlewood Pizza!", usrName );
        SendClientMessageToAll( ROB, szStr );

        GameTextForPlayer( playerid, "~g~Robbery in process~n~~r~Do not leave the checkpoint!", 30000, 3 );
        SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) +2);
        return true;
}


public robPizza( playerid )
{
        new
            randMoney = random( 96000 );

        GivePlayerMoney( playerid, randMoney );

        new
            szStr[ 128 ],
            szStr1[128],
            usrName[ 24 ];

        GetPlayerName( playerid, usrName, 24 );
        format( szStr, 128, "[ROBBERY] %s has robbed $%d from Idlewood Pizza!", usrName, randMoney );
        SendClientMessageToAll( ROB, szStr );

        format( szStr, 128, "[ROBBERY INFO] Robbery succesfull! You have earned $%d and 1 score from the robbery.", randMoney );
        SendClientMessage( playerid, INFO, szStr );

        pRobbingP[ playerid ] = false;
        SetTimer( "pizzaDelay", 90000, false );

        format(szStr1, sizeof (szStr1), "~g~You have succesfuly robbed $%d from Idlewood Pizza!", randMoney);
        GameTextForPlayer( playerid, szStr1, 3000, 3 );

        SetPlayerScore(playerid, GetPlayerScore(playerid) +1 );
        pInfo[ playerid ][ Robskill ] ++;
}


forward pizzaDelay( );
public pizzaDelay( )
{
    pizzaRobbed = false;
    return true;
}
Reply
#2

You need to create a pInfo enum and a variable for ROB and INFO.
Reply
#3

Create enum first!
Reply
#4

Some one help pls

pawn Код:
\filterscripts\robbery.pwn(104) : error 017: undefined symbol "ROB"
\filterscripts\robbery.pwn(107) : error 017: undefined symbol "INFO"
\filterscripts\robbery.pwn(126) : warning 203: symbol is never used: "robpizza"
Code:

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


enum
    e_PlayerInfo
{
    Score,
    Robskill,
    Money,
    Kills,
    Deaths
};

new pInfo[MAX_PLAYERS][e_PlayerInfo];


forward robPizza( playerid ); //Add this to the top of your script under your includes!

new
        robTimerP[ MAX_PLAYERS ],
        cp_Pizza,
        bool: pRobbingP[ MAX_PLAYERS ],
        bool: pizzaRobbed;


public OnFilterScriptInit()
{
    cp_Pizza = CreateDynamicCP( 378.2259, -114.4946, 1001.4922, 2.0, .interiorid = 5);
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerEnterDynamicCP( playerid, checkpointid )
{
    if( pRobbingP[ playerid ] )
    {
            if ( checkpointid == cp_Pizza )
            {
                pRobbingP[ playerid ] = false;
                KillTimer( robTimerP[ playerid ] );
                pizzaRobbed = false;
                GameTextForPlayer( playerid, "~r~You have failed the robbery!", 1000, 3 );
            }
    }
    return true;
}

//IDLEWOOD PIZZA

CMD:robpizza( playerid, params[ ] )
{

        if ( pRobbingP[ playerid ] )
                return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} You are already robbing Idlewood Pizza" );

        if ( !IsPlayerInRangeOfPoint( playerid, 3.0, 378.2259, -114.4946, 1001.4922 ) )
            return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} You must be in the checkpoint at Idlewood Pizza to use this command!" );

        if ( pizzaRobbed )
            return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} Idlewood Pizza has been robbed recently, please wait patiently!" );

        robTimerP[ playerid ] = SetTimerEx( "robPizza", 30000, false, "i", playerid );

        SendClientMessage( playerid, INFO, "[ROBBERY INFO] You have started a robbery, it will last 30 seconds. Do not leave the checkpoint!" );

        pRobbingP[ playerid ] = true;
        pizzaRobbed = true;

        new
            szStr[ 128 ],
            usrName[ 24 ];

        GetPlayerName( playerid, usrName, 24 );
        format( szStr, 128, "[ROBBERY] %s has began a robbery at Idlewood Pizza!", usrName );
        SendClientMessageToAll( ROB, szStr );

        GameTextForPlayer( playerid, "~g~Robbery in process~n~~r~Do not leave the checkpoint!", 30000, 3 );
        SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) +2);
        return true;
}


public robPizza( playerid )
{
        new
            randMoney = random( 96000 );

        GivePlayerMoney( playerid, randMoney );

        new
            szStr[ 128 ],
            szStr1[128],
            usrName[ 24 ];

        GetPlayerName( playerid, usrName, 24 );
        format( szStr, 128, "[ROBBERY] %s has robbed $%d from Idlewood Pizza!", usrName, randMoney );
        SendClientMessageToAll( ROB, szStr );

        format( szStr, 128, "[ROBBERY INFO] Robbery succesfull! You have earned $%d and 1 score from the robbery.", randMoney );
        SendClientMessage( playerid, INFO, szStr );

        pRobbingP[ playerid ] = false;
        SetTimer( "pizzaDelay", 90000, false );

        format(szStr1, sizeof (szStr1), "~g~You have succesfuly robbed $%d from Idlewood Pizza!", randMoney);
        GameTextForPlayer( playerid, szStr1, 3000, 3 );

        SetPlayerScore(playerid, GetPlayerScore(playerid) +1 );
        pInfo[ playerid ][ Robskill ] ++;
}


forward pizzaDelay( );
public pizzaDelay( )
{
    pizzaRobbed = false;
    return true;
}
Reply
#5

after

pawn Код:
#include <a_samp>
#include <Streamer>
add

pawn Код:
#define INFO 0xFFFFFFAA
#define ROB 0xFF0000AA

EDIT:
Add at includes
pawn Код:
#include <zcmd>
Reply
#6

When i go into the checkpoint and i type the command nothing happens, not even the message. Someone help!!
Reply
#7

Help pls!
Reply
#8

Do not Spam And Hii Lol
And You haven't defined those colors So Instead Of Rob and info add a -1 And try
Reply
#9

Quote:
Originally Posted by rockhopper
Посмотреть сообщение
Do not Spam And Hii Lol
And You haven't defined those colors So Instead Of Rob and info add a -1 And try
Where should i put -1?
Reply
#10

In place od Rob And Info
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)