Robbery system help -
ponagandlamanoj - 25.02.2014
Guys, I have a cnr GM, While robbing a store, dialog box appears and makes player unable to move. So i want to remove dialog and put textdraw counter and if player moves out of checkpoint, robbery should fail. Can anyone please help with the following code
Код:
if(getCheckpointType(playerid) == CP_ZipMain)
{
if(zones[current_zone][zone_name] == zones[49][zone_name] || zones[current_zone][zone_name] == zones[50][zone_name] ||
zones[current_zone][zone_name] == zones[51][zone_name] || zones[current_zone][zone_name] == zones[52][zone_name] ||
zones[current_zone][zone_name] == zones[53][zone_name] || zones[current_zone][zone_name] == zones[54][zone_name])
{
if(DownZipRobbedRecently >= 1)
{
SendClientMessage(playerid,COLOR_ERROR,"The Downtown Zip has been robbed recently.");
return 1;
}
if(rrand <= 30)
{
SendClientMessage(playerid,COLOR_ERROR,"Downtown Zip robbery failed.");
DownZipRobbedRecently =320;
return 1;
}
DownZipRobbedRecently =320;
RobbingDownZip[playerid] =25;
IncreaseWantedLevel(playerid,4);
IncreasePlayerScore(playerid,1);
format(string,sizeof(string),"Robbing Zip.\nFinish Robbery in: %d seconds.\nPolice are on the way.",RobbingDownZip[playerid]);
ShowPlayerDialog(playerid,DIALOG_ZIP,DIALOG_STYLE_MSGBOX,"{FF0000}Zip Robbery",string,"Ok","Cancel");
format(string,sizeof(string),"[POLICE RADIO] Suspect %s(%d) has begun to rob the Downtown Zip! Get To Zip and arrest the suspect.",PlayerName(playerid),playerid);
SendClientMessageToAllCops(string);
format(string,sizeof(string),"[ROBBERY] %s(%d) has begun a robbery at Zip ..",PlayerName(playerid),playerid);
SendClientMessageToAll(COLOR_RED,string);
format(string,sizeof(string),"4[ROBBERY] %s(%d) has begun a robbery at Zip ..",PlayerName(playerid),playerid);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
return 1;
}
return 1;
}
Re: Robbery system help -
amirab - 25.02.2014
LoooooL
San Fierro Cops And Robbers
Ok
at first you should create a textdraw then make it like a counter
make counter by timers
then show it when player is robbing
and set controlable to 1
and remove show dialog line
Sry For My Bad English
Re: Robbery system help -
ponagandlamanoj - 25.02.2014
LOL.. YEA>>> thats what i cant do. I dont know know how to create textdraw. can ya please help me
http://www.********.com/pmanoj.pandu or
Skype : P Manoj MJ or else here itself.
Respuesta: Robbery system help -
CuervO - 25.02.2014
This is not really the script request thread.
To check if the player is in a checkpoint and has left it you're gonna have to use a timer with either IsPlayerInDynamicCP (IF you've got streamer) or
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint.
As for the textdraw use either Zamaroth's Editor or iPleomax's editor. The last one is more easy to use but it is hard to use when it comes about exact precission while the first one is more about precission but harder to understand.
https://sampwiki.blast.hk/wiki/TextDrawCreate and all it's related functions
Re: Robbery system help -
ponagandlamanoj - 25.02.2014
Kay, sorry for requesting here. So, i must create a textdraw and create a timer and link them both?
Respuesta: Re: Robbery system help -
CuervO - 25.02.2014
Quote:
Originally Posted by ponagandlamanoj
Kay, sorry for requesting here. So, i must create a textdraw and create a timer and link them both?
|
Indeed. Check that you don't have already a timer for that because apparently you do:
RobbingDownZip[playerid] -> that variable is linked to the time of robbery, you can link that to the textdraw.
Re: Robbery system help -
ponagandlamanoj - 25.02.2014
For all the robberies i hav dialogs.