16.10.2013, 17:00
Hello SA-MP Forum and All scripters there , i want make tutorial
Simple RobAtm System , and how it works
If you /robatm you will wait for a sec for rob the atm
you will get money from the ATM
and you will rob able again with timer
sorry for my bad english![Smiley](images/smilies/smile.png)
================================================== ==========
Its for variable will make timer for robbing and giveplayer money
you cant edit the money what you want
its will create timer for make ATM is rob able again
And this the command for robbing the ATM
All In One
You Need Edit Your Own Variables ,
GivePlayerCash mean GivePlayerMoney
you can change it to your variable , sorry for my bad english hope you like it
Simple RobAtm System , and how it works
If you /robatm you will wait for a sec for rob the atm
you will get money from the ATM
and you will rob able again with timer
sorry for my bad english
![Smiley](images/smilies/smile.png)
================================================== ==========
Its for variable will make timer for robbing and giveplayer money
you cant edit the money what you want
pawn Code:
new Robatm[MAX_PLAYERS]; // Add This At Top Bottom your define
#define COLOR_WHITE 0xFFFFFFAA //This for the colour
forward RobAtm(playerid);
public RobAtm(playerid)
{
if(GetPlayerWeapon(playerid) == 0) GivePlayerCash(playerid,500); //It Will Give 500$ If You Holding Weapon ID's 0
if(GetPlayerWeapon(playerid) == 22) GivePlayerCash(playerid,700); // Same Like Top
if(GetPlayerWeapon(playerid) == 23) GivePlayerCash(playerid,1000);
if(GetPlayerWeapon(playerid) == 24) GivePlayerCash(playerid,1500);
if(GetPlayerWeapon(playerid) == 25) GivePlayerCash(playerid,1700);
if(GetPlayerWeapon(playerid) == 26) GivePlayerCash(playerid,2000);
if(GetPlayerWeapon(playerid) == 27) GivePlayerCash(playerid,2500);
if(GetPlayerWeapon(playerid) == 28) GivePlayerCash(playerid,2700);
if(GetPlayerWeapon(playerid) == 29) GivePlayerCash(playerid,3500);
if(GetPlayerWeapon(playerid) == 30) GivePlayerCash(playerid,3700);
if(GetPlayerWeapon(playerid) == 31) GivePlayerCash(playerid,4000);
if(GetPlayerWeapon(playerid) == 32) GivePlayerCash(playerid,4500);
if(GetPlayerWeapon(playerid) == 33) GivePlayerCash(playerid,4700);
if(GetPlayerWeapon(playerid) == 34) GivePlayerCash(playerid,5000);
if(GetPlayerWeapon(playerid) == 35) GivePlayerCash(playerid,5500);
if(GetPlayerWeapon(playerid) == 36) GivePlayerCash(playerid,10000);
SendClientMessage(playerid, COLOR_WHITE, "You Rob the Atm and now have 6 wanted level!");
WantedPoints[playerid] = 6; // Your Variable Wanted
SetPlayerWantedLevel(playerid, 6);
PlayerInfo[playerid][pWantedLevel] = 6; // Your Variable Wanted
TogglePlayerControllable(playerid,1);
return 1;
}
pawn Code:
//This Timer For Make Robatm Able Again
forward after7(playerid);
public after7(playerid)
{
Robatm[playerid] = 0;
SendClientMessage(playerid, COLOR_WHITE, " You can rob atm again!");
return 1;
}
pawn Code:
CMD:robatm(playerid, params[])
{
if(!IsAtATM(playerid)) // You Can Change This To Your Own Coordinat
{
SendClientMessage(playerid, COLOR_WHITE, " You are not at ATM !!");
return 1;
}
if (Robatm[playerid] == 0 )
{
SendClientMessage(playerid, COLOR_WHITE, "You now robbing !!!");
Robatm[playerid] = 1;
SendCopMessage(COLOR_WHITE, "Stranger: Help someone trying to rob ATM!"); //It Will Send Cop Message if you have faction , you cant delete it if you not want to use it
SetTimerEx("RobAtm", 10000, false, "i", playerid); // It for robbing timer
SetTimerEx("after7", 15*60*1000, false, "i", playerid); // it for make robbing able again
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "[Info:]You Are Not At ATM !");
}
return 1;
}
pawn Code:
new Robatm[MAX_PLAYERS]; // Add This At Top Bottom your define
#define COLOR_WHITE 0xFFFFFFAA //This for the colour
forward RobAtm(playerid);
public RobAtm(playerid)
{
if(GetPlayerWeapon(playerid) == 0) GivePlayerCash(playerid,500); //It Will Give 500$ If You Holding Weapon ID's 0
if(GetPlayerWeapon(playerid) == 22) GivePlayerCash(playerid,700); // Same Like Top
if(GetPlayerWeapon(playerid) == 23) GivePlayerCash(playerid,1000);
if(GetPlayerWeapon(playerid) == 24) GivePlayerCash(playerid,1500);
if(GetPlayerWeapon(playerid) == 25) GivePlayerCash(playerid,1700);
if(GetPlayerWeapon(playerid) == 26) GivePlayerCash(playerid,2000);
if(GetPlayerWeapon(playerid) == 27) GivePlayerCash(playerid,2500);
if(GetPlayerWeapon(playerid) == 28) GivePlayerCash(playerid,2700);
if(GetPlayerWeapon(playerid) == 29) GivePlayerCash(playerid,3500);
if(GetPlayerWeapon(playerid) == 30) GivePlayerCash(playerid,3700);
if(GetPlayerWeapon(playerid) == 31) GivePlayerCash(playerid,4000);
if(GetPlayerWeapon(playerid) == 32) GivePlayerCash(playerid,4500);
if(GetPlayerWeapon(playerid) == 33) GivePlayerCash(playerid,4700);
if(GetPlayerWeapon(playerid) == 34) GivePlayerCash(playerid,5000);
if(GetPlayerWeapon(playerid) == 35) GivePlayerCash(playerid,5500);
if(GetPlayerWeapon(playerid) == 36) GivePlayerCash(playerid,10000);
SendClientMessage(playerid, COLOR_WHITE, "You Rob the Atm and now have 6 wanted level!");
WantedPoints[playerid] = 6; // Your Variable Wanted
SetPlayerWantedLevel(playerid, 6);
PlayerInfo[playerid][pWantedLevel] = 6; // Your Variable Wanted
TogglePlayerControllable(playerid,1);
return 1;
}
//This Timer For Make Robatm Able Again
forward after7(playerid);
public after7(playerid)
{
Robatm[playerid] = 0;
SendClientMessage(playerid, COLOR_WHITE, " You can rob atm again!");
return 1;
}
CMD:robatm(playerid, params[])
{
if(!IsAtATM(playerid)) // You Can Change This To Your Own Coordinat
{
SendClientMessage(playerid, COLOR_WHITE, " You are not at ATM !!");
return 1;
}
if (Robatm[playerid] == 0 )
{
SendClientMessage(playerid, COLOR_WHITE, "You now robbing !!!");
Robatm[playerid] = 1;
SendCopMessage(COLOR_WHITE, "Stranger: Help someone trying to rob ATM!"); //It Will Send Cop Message if you have faction , you cant delete it if you not want to use it
SetTimerEx("RobAtm", 10000, false, "i", playerid); // It for robbing timer
SetTimerEx("after7", 15*60*1000, false, "i", playerid); // it for make robbing able again
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "[Info:]You Are Not At ATM !");
}
return 1;
}
GivePlayerCash mean GivePlayerMoney
you can change it to your variable , sorry for my bad english hope you like it
![Smiley](images/smilies/smile.png)