Replacement help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Replacement help (
/showthread.php?tid=513603)
Replacement help -
weedxd - 17.05.2014
Oks so the old robbery system looks like this but i want to make it better
Note:This is only the gym
PHP код:
if(getCheckpointType(playerid) == CP_GYM)
{
if(zones[current_zone][zone_name] == zones[116][zone_name] || zones[current_zone][zone_name] == zones[117][zone_name])
{
if(GYMRobbedRecently >= 1)
{
SendClientMessage(playerid,COLOR_GREY,"{FF0000}[ERROR]: {FFFFFF}The GYM has been robbed recently.");
return 1;
}
if(rrand <= 30)
{
SendClientMessage(playerid,COLOR_GREY,"{FF0000}GYM robbery failed.");
GYMRobbedRecently =320;
return 1;
}
GYMRobbedRecently =320;
RobbingGYM[playerid] =25;
IncreaseWantedLevel(playerid,4);
IncreasePlayerScore(playerid,1);
format(string,sizeof(string),"{0000FF}Crime in Progesss: GYM Robbery - %s(%d) has Started to Rob GYM - Location: Garcia",PlayerName(playerid),playerid);
SendClientMessageToAllCops(string);
format(string,sizeof(string),"",PlayerName(playerid),playerid);
SendClientMessageToAll(COLOR_PURPLE,string);
format(string,sizeof(string),"4[ROBBERY] %s(%d) has begun a robbery at the GYM ..",PlayerName(playerid),playerid);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
return 1;
}
return 1;
}
But i want to remake it to this But how can i do it ?;/
Edit this more like and ignition system for the old robbery system
PHP код:
public OnFilterScriptInit() {
//GYM
CreateObject(2332, 754.16119, -40.84430, 999.99481, 0.00000, 0.00000, 90.00000);
return 1;
}
//If In range
if OnPlayerCommandText(playerid, "/robstore"))
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, 754.16119, -40.84430, 999.99481))
{
SendClientMessage(playerid,0xFFFFFFFF,"Press C to start robbery!");
}
if GYMRobbedRecently =0(playerid
return 1;
}
//Keybind
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_CROUCH))
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, 754.16119, -40.84430, 999.99481))
{
OnPlayerCommandText(playerid, "/robstore");
}
}
return 1;
}
//Timer
forward message();
public OnGameModeInit()
{
print("You have started to rob the GYM");
SetTimer("message", 25000, false);
}
public message()
{
format(string,sizeof(string),"{FFFF00}%s(%d) {FFFFFF}has Robbed a total of {00FFFF}$%d {FFFFFF}from the GYM In {BA55D3}Garcia",pname,i,mrand);
SendClientMessageToAll(COLOR_PURPLE,string);
format(string,sizeof(string),"4{FFFF00}%s(%d) {FFFFFF}has Robbed a total of {00FFFF}$%d {FFFFFF}from the GYM In {BA55D3}Garcia",pname,i,mrand);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
return 1
}