SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 05/02/2014, 04:45 PM   #11
Crazydriver
Big Clucker
 
Crazydriver's Avatar
 
Join Date: Jan 2014
Location: Germany
Posts: 125
Reputation: 5
Default Re: Robbery

it's giving me errors can you explain this in detail where to put or should i send you the codes and you should check and tell me where to put it?
__________________
Crazydriver is offline   Reply With Quote
Old 05/02/2014, 04:52 PM   #12
Beckett
High-roller
 
Beckett's Avatar
 
Join Date: Feb 2012
Location: www.finalnights-rp.com
Posts: 1,773
Reputation: 104
Default Re: Robbery

It doesn't matter Variable is a variable if MYSQL or anything else, but if you wanna make it save upon GamemodeExit then you'll have to.

Atleast send me your command that robs or whatever and I'll do it.
Beckett is offline   Reply With Quote
Old 05/02/2014, 06:34 PM   #13
Crazydriver
Big Clucker
 
Crazydriver's Avatar
 
Join Date: Jan 2014
Location: Germany
Posts: 125
Reputation: 5
Default Re: Robbery

Here you go?
PHP Code:
dcmd_robbery(playeridparams[])
{
    
#pragma unused params
    
if (PlayerInfo[playerid][pSpawn] == 1){

    if (
PlayerInfo[playerid][pTeam] == TEAM_CIVILIAN && PlayerInfo[playerid][pVigilante] == 0){

    new 
string[256];


    if (
GetPlayerVirtualWorld(playerid) > 0)
    {

    new 
Houseid PlayerInfo[playerid][pCheckpoint];


    
//if (CURRENT_GAMEMODE == SAN_FIERRO)
    //{


    
if (!IsPlayerInCheckpoint(playerid))
    {
    
SendClientMessage(playeridCOLOR_ERROR"You Must Be In A Red Robbery Checkpoint To Attempt A Robbery.");
    return 
1;
    }

    if (
HouseInfo[Houseid][h_cpbustype] == BUS_TYPE_CrazyDriverS_PLACE || HouseInfo[Houseid][h_cpbustype] == BUS_TYPE_OBSERVATORY || HouseInfo[Houseid][h_cpbustype] == BUS_TYPE_SA_FED_MINT || HouseInfo[Houseid][h_cpbustype] == BUS_TYPE_WOOZIE_PRV_CLUB || HouseInfo[Houseid][h_cpbustype] == BUS_TYPE_JIZZY_DOME)
    {


    if (
PlayerInfo[playerid][pWantedLevel] > 0)
    {
    
SendClientMessage(playerid,COLOR_ERROR"You Must Be Innocent To Begin A Robbery.");
    return 
1;
    }

    if(
PlayerInfo[playerid][pJailed] == 1)
    {
    
SendClientMessage(playeridCOLOR_ERROR"You Cannot Use This Command In Jail.");
    return 
1;
    }

    if(
PlayerInfo[playerid][pAJailed] == 1)
    {
    
SendClientMessage(playeridCOLOR_ERROR"You Cannot Use This Command In Jail.");
    return 
1;
    }

    if(
PlayerInfo[playerid][pHoldup] > 0)
    {
    
SendClientMessage(playeridCOLOR_ERROR"You Are Currently Robbing The Store.  Exit The Checkpoint To End The Holdup.");
    return 
1;
    }

    if(
PlayerInfo[playerid][pHoldupWaitTime] > 0)
    {
    
SendClientMessage(playeridCOLOR_ERROR"Please Wait Before Robbing A Store Again.");
    return 
1;
    }

    if (
HouseData[Houseid][h_RobWaitTime] > 0)
    {
    
format(stringsizeof(string), "The %s Has Been Robbed Recently.  Try Again Later.",HouseInfo[Houseid][h_HouseIntName]);
    
SendClientMessage(playeridCOLOR_ERRORstring);
    return 
1;
    }
    
    if (!
IsPlayerInGamemodeArea(playerid))
    {
    
format(stringsizeof(string), "You Can Only Rob Places In %s.",ServerInfo[sMapName]);
    
SendClientMessage(playeridCOLOR_ERRORstring);
    return 
1;
    }
    
format(stringsizeof(string), "The %s",HouseInfo[Houseid][h_HouseIntName]);
    
strmid(PlayerInfo[playerid][pHoldupVictim], string0128128);
    
HouseData[Houseid][h_RobWaitTime] = 60;
    
PlayerInfo[playerid][pHoldup] = 30;
    
PlayerInfo[playerid][pHoldupWaitTime] = 60;
    
PlayerInfo[playerid][pHoldupAmount] = 0;
    
HideTextDrawMenu(playerid);
    
PlayerInfo[playerid][pWantedLevel] = 6;
    
PlayerInfo[playerid][pRobberies] ++;
    
PlayerInfo[playerid][pMission] = MISSION_TYPE_ROBBERY;
    
ApplyAnimation(playerid"SHOP""ROB_Shifty"3.0000001);
    
SendClientMessage(playeridCOLOR_SERVER_HELP_MSG"Beginning Robbery...  Exit The Checkpoint To End The Robbery.");
    
GameTextForPlayer(playerid,"~w~BEGINNING ROBBERY~n~~y~STAY IN THE~n~~r~RED CHECKPOINT"50003);

    
SetPlayerScore(playerid,GetPlayerScore(playerid) + 1);
    
    
format(stringsizeof(string), "Crime: Robbery In Progress");
    
ReportCrimeTOPolice(playerid,string);
    
SetPlayerWantedStats(playerid,"Robbery");


    }else{
    
SendClientMessage(playeridCOLOR_ERROR"You Must Be In A Robbery Checkpoint To Begin A Robbery.");
    }

    
//}else{
    //format(string, sizeof(string), "You Cannot Rob The San Fierro Mint While Playing %s.",ServerInfo[sMapName]);
    //SendClientMessage(playerid, COLOR_ERROR, string);
    //}


    
}else{
    
SendClientMessage(playeridCOLOR_ERROR"You Must Be Inside The San Fierro Federal Mint To Begin A Robbery.");
    }


    }else{
    
SendClientMessage(playeridCOLOR_ERROR"Law Enforcement Agents Cannot Rob Places.");
    }

    }else{
    
SendClientMessage(playeridCOLOR_ERROR"You Cannot Use This Command When You're Dead.");
    }

    return 
1;

__________________
Crazydriver is offline   Reply With Quote
Old 09/02/2014, 05:35 AM   #14
Crazydriver
Big Clucker
 
Crazydriver's Avatar
 
Join Date: Jan 2014
Location: Germany
Posts: 125
Reputation: 5
Default AW: Robbery

Will Somebody help me ?
__________________
Crazydriver is offline   Reply With Quote
Old 09/02/2014, 05:54 AM   #15
_Mohit_
Big Clucker
 
Join Date: Sep 2012
Location: India
Posts: 83
Reputation: 5
Default Re: Robbery

Quote:
Originally Posted by Crazydriver View Post
Here you go?
PHP Code:
dcmd_robbery(playeridparams[])
{
    
#pragma unused params
    
if (PlayerInfo[playerid][pSpawn] == 1){

    if (
PlayerInfo[playerid][pTeam] == TEAM_CIVILIAN && PlayerInfo[playerid][pVigilante] == 0){

    new 
string[256];


    if (
GetPlayerVirtualWorld(playerid) > 0)
    {

    new 
Houseid PlayerInfo[playerid][pCheckpoint];


    
//if (CURRENT_GAMEMODE == SAN_FIERRO)
    //{


    
if (!IsPlayerInCheckpoint(playerid))
    {
    
SendClientMessage(playeridCOLOR_ERROR"You Must Be In A Red Robbery Checkpoint To Attempt A Robbery.");
    return 
1;
    }

    if (
HouseInfo[Houseid][h_cpbustype] == BUS_TYPE_CrazyDriverS_PLACE || HouseInfo[Houseid][h_cpbustype] == BUS_TYPE_OBSERVATORY || HouseInfo[Houseid][h_cpbustype] == BUS_TYPE_SA_FED_MINT || HouseInfo[Houseid][h_cpbustype] == BUS_TYPE_WOOZIE_PRV_CLUB || HouseInfo[Houseid][h_cpbustype] == BUS_TYPE_JIZZY_DOME)
    {


    if (
PlayerInfo[playerid][pWantedLevel] > 0)
    {
    
SendClientMessage(playerid,COLOR_ERROR"You Must Be Innocent To Begin A Robbery.");
    return 
1;
    }

    if(
PlayerInfo[playerid][pJailed] == 1)
    {
    
SendClientMessage(playeridCOLOR_ERROR"You Cannot Use This Command In Jail.");
    return 
1;
    }

    if(
PlayerInfo[playerid][pAJailed] == 1)
    {
    
SendClientMessage(playeridCOLOR_ERROR"You Cannot Use This Command In Jail.");
    return 
1;
    }

    if(
PlayerInfo[playerid][pHoldup] > 0)
    {
    
SendClientMessage(playeridCOLOR_ERROR"You Are Currently Robbing The Store.  Exit The Checkpoint To End The Holdup.");
    return 
1;
    }

    if(
PlayerInfo[playerid][pHoldupWaitTime] > 0)
    {
    
SendClientMessage(playeridCOLOR_ERROR"Please Wait Before Robbing A Store Again.");
    return 
1;
    }

    if (
HouseData[Houseid][h_RobWaitTime] > 0)
    {
    
format(stringsizeof(string), "The %s Has Been Robbed Recently.  Try Again Later.",HouseInfo[Houseid][h_HouseIntName]);
    
SendClientMessage(playeridCOLOR_ERRORstring);
    return 
1;
    }
    
    if (!
IsPlayerInGamemodeArea(playerid))
    {
    
format(stringsizeof(string), "You Can Only Rob Places In %s.",ServerInfo[sMapName]);
    
SendClientMessage(playeridCOLOR_ERRORstring);
    return 
1;
    }
    
format(stringsizeof(string), "The %s",HouseInfo[Houseid][h_HouseIntName]);
    
strmid(PlayerInfo[playerid][pHoldupVictim], string0128128);
    
HouseData[Houseid][h_RobWaitTime] = 60;
    
PlayerInfo[playerid][pHoldup] = 30;
    
PlayerInfo[playerid][pHoldupWaitTime] = 60;
    
PlayerInfo[playerid][pHoldupAmount] = 0;
    
HideTextDrawMenu(playerid);
    
PlayerInfo[playerid][pWantedLevel] = 6;
    
PlayerInfo[playerid][pRobberies] ++;
    
PlayerInfo[playerid][pMission] = MISSION_TYPE_ROBBERY;
    
ApplyAnimation(playerid"SHOP""ROB_Shifty"3.0000001);
    
SendClientMessage(playeridCOLOR_SERVER_HELP_MSG"Beginning Robbery...  Exit The Checkpoint To End The Robbery.");
    
GameTextForPlayer(playerid,"~w~BEGINNING ROBBERY~n~~y~STAY IN THE~n~~r~RED CHECKPOINT"50003);

    
SetPlayerScore(playerid,GetPlayerScore(playerid) + 1);
    
    
format(stringsizeof(string), "Crime: Robbery In Progress");
    
ReportCrimeTOPolice(playerid,string);
    
SetPlayerWantedStats(playerid,"Robbery");


    }else{
    
SendClientMessage(playeridCOLOR_ERROR"You Must Be In A Robbery Checkpoint To Begin A Robbery.");
    }

    
//}else{
    //format(string, sizeof(string), "You Cannot Rob The San Fierro Mint While Playing %s.",ServerInfo[sMapName]);
    //SendClientMessage(playerid, COLOR_ERROR, string);
    //}


    
}else{
    
SendClientMessage(playeridCOLOR_ERROR"You Must Be Inside The San Fierro Federal Mint To Begin A Robbery.");
    }


    }else{
    
SendClientMessage(playeridCOLOR_ERROR"Law Enforcement Agents Cannot Rob Places.");
    }

    }else{
    
SendClientMessage(playeridCOLOR_ERROR"You Cannot Use This Command When You're Dead.");
    }

    return 
1;

You put it anywhere in the script.But not under any stock or public.if you want,you can put it at the end of your script.
_Mohit_ is offline   Reply With Quote
Old 09/02/2014, 06:30 AM   #16
Crazydriver
Big Clucker
 
Crazydriver's Avatar
 
Join Date: Jan 2014
Location: Germany
Posts: 125
Reputation: 5
Default AW: Robbery

Quote:
You put it anywhere in the script.But not under any stock or public.if you want,you can put it at the end of your script.
I have put it under OnPlayerCommandText
__________________
Crazydriver is offline   Reply With Quote
Old 09/02/2014, 08:23 AM   #17
_Mohit_
Big Clucker
 
Join Date: Sep 2012
Location: India
Posts: 83
Reputation: 5
Default Re: AW: Robbery

Quote:
Originally Posted by Crazydriver View Post
I have put it under OnPlayerCommandText
You put this under OnPlayerCommandText

PHP Code:
dcmd(robbery,7,cmdtext); 
And at the end of your script or gm

PHP Code:
dcmd_robbery(playeridparams[]) 

    
#pragma unused params 
    
if (PlayerInfo[playerid][pSpawn] == 1){ 

    if (
PlayerInfo[playerid][pTeam] == TEAM_CIVILIAN && PlayerInfo[playerid][pVigilante] == 0){ 

    new 
string[256]; 


    if (
GetPlayerVirtualWorld(playerid) > 0
    { 

    new 
Houseid PlayerInfo[playerid][pCheckpoint]; 


    
//if (CURRENT_GAMEMODE == SAN_FIERRO) 
    //{ 


    
if (!IsPlayerInCheckpoint(playerid)) 
    { 
    
SendClientMessage(playeridCOLOR_ERROR"You Must Be In A Red Robbery Checkpoint To Attempt A Robbery."); 
    return 
1
    } 

    if (
HouseInfo[Houseid][h_cpbustype] == BUS_TYPE_CrazyDriverS_PLACE || HouseInfo[Houseid][h_cpbustype] == BUS_TYPE_OBSERVATORY || HouseInfo[Houseid][h_cpbustype] == BUS_TYPE_SA_FED_MINT || HouseInfo[Houseid][h_cpbustype] == BUS_TYPE_WOOZIE_PRV_CLUB || HouseInfo[Houseid][h_cpbustype] == BUS_TYPE_JIZZY_DOME
    { 


    if (
PlayerInfo[playerid][pWantedLevel] > 0
    { 
    
SendClientMessage(playerid,COLOR_ERROR"You Must Be Innocent To Begin A Robbery."); 
    return 
1
    } 

    if(
PlayerInfo[playerid][pJailed] == 1
    { 
    
SendClientMessage(playeridCOLOR_ERROR"You Cannot Use This Command In Jail."); 
    return 
1
    } 

    if(
PlayerInfo[playerid][pAJailed] == 1
    { 
    
SendClientMessage(playeridCOLOR_ERROR"You Cannot Use This Command In Jail."); 
    return 
1
    } 

    if(
PlayerInfo[playerid][pHoldup] > 0
    { 
    
SendClientMessage(playeridCOLOR_ERROR"You Are Currently Robbing The Store.  Exit The Checkpoint To End The Holdup."); 
    return 
1
    } 

    if(
PlayerInfo[playerid][pHoldupWaitTime] > 0
    { 
    
SendClientMessage(playeridCOLOR_ERROR"Please Wait Before Robbing A Store Again."); 
    return 
1
    } 

    if (
HouseData[Houseid][h_RobWaitTime] > 0
    { 
    
format(stringsizeof(string), "The %s Has Been Robbed Recently.  Try Again Later.",HouseInfo[Houseid][h_HouseIntName]); 
    
SendClientMessage(playeridCOLOR_ERRORstring); 
    return 
1
    } 
     
    if (!
IsPlayerInGamemodeArea(playerid)) 
    { 
    
format(stringsizeof(string), "You Can Only Rob Places In %s.",ServerInfo[sMapName]); 
    
SendClientMessage(playeridCOLOR_ERRORstring); 
    return 
1
    } 
    
format(stringsizeof(string), "The %s",HouseInfo[Houseid][h_HouseIntName]); 
    
strmid(PlayerInfo[playerid][pHoldupVictim], string0128128); 
    
HouseData[Houseid][h_RobWaitTime] = 60
    
PlayerInfo[playerid][pHoldup] = 30
    
PlayerInfo[playerid][pHoldupWaitTime] = 60
    
PlayerInfo[playerid][pHoldupAmount] = 0
    
HideTextDrawMenu(playerid); 
    
PlayerInfo[playerid][pWantedLevel] = 6
    
PlayerInfo[playerid][pRobberies] ++; 
    
PlayerInfo[playerid][pMission] = MISSION_TYPE_ROBBERY
    
ApplyAnimation(playerid"SHOP""ROB_Shifty"3.0000001); 
    
SendClientMessage(playeridCOLOR_SERVER_HELP_MSG"Beginning Robbery...  Exit The Checkpoint To End The Robbery."); 
    
GameTextForPlayer(playerid,"~w~BEGINNING ROBBERY~n~~y~STAY IN THE~n~~r~RED CHECKPOINT"50003); 

    
SetPlayerScore(playerid,GetPlayerScore(playerid) + 1); 
     
    
format(stringsizeof(string), "Crime: Robbery In Progress"); 
    
ReportCrimeTOPolice(playerid,string); 
    
SetPlayerWantedStats(playerid,"Robbery"); 


    }else{ 
    
SendClientMessage(playeridCOLOR_ERROR"You Must Be In A Robbery Checkpoint To Begin A Robbery."); 
    } 

    
//}else{ 
    //format(string, sizeof(string), "You Cannot Rob The San Fierro Mint While Playing %s.",ServerInfo[sMapName]); 
    //SendClientMessage(playerid, COLOR_ERROR, string); 
    //} 


    
}else{ 
    
SendClientMessage(playeridCOLOR_ERROR"You Must Be Inside The San Fierro Federal Mint To Begin A Robbery."); 
    } 


    }else{ 
    
SendClientMessage(playeridCOLOR_ERROR"Law Enforcement Agents Cannot Rob Places."); 
    } 

    }else{ 
    
SendClientMessage(playeridCOLOR_ERROR"You Cannot Use This Command When You're Dead."); 
    } 

    return 
1

_Mohit_ is offline   Reply With Quote
Old 09/02/2014, 08:27 AM   #18
Crazydriver
Big Clucker
 
Crazydriver's Avatar
 
Join Date: Jan 2014
Location: Germany
Posts: 125
Reputation: 5
Default AW: Robbery

/sigh I know that where to put the codes i'm not asking that
__________________
Crazydriver is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
robbery SampzzonE Scripting Help 0 10/08/2013 11:01 PM
Help me with robbery's! BodyBoardVEVO Scripting Help 2 02/04/2013 03:08 PM
robbery or something... Er@x3r General 2 26/08/2012 08:13 AM
Robbery bug help StinkMoney Scripting Help 10 02/05/2012 02:58 AM
robbery help CrazyBlob Help Archive 4 12/04/2011 06:11 PM


All times are GMT. The time now is 06:25 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.