SA-MP Forums Archive
[Request]Robing :) - 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: [Request]Robing :) (/showthread.php?tid=554487)



[Request]Robing :) - astanalol - 03.01.2015

Hello
i Want Made Robing With This Way Please
1.if player in interior 10 and in this pos he is can start robing
PHP код:
319.60,-220.10,0.00,104.5 
2.if player not there in this interior 10 and this pos Message To Him / u Are Not Near Robing
3.Timer To Watting in Checkpoints 30Sec
4.Take Money 10000$
5.if he is out from interior 10 the robing failds and not take the money
6.he is watting to use this commands again after 3min
Thanks
Please Help Me +Reps


Re: [Request]Robing :) - Sid_Alexander - 04.01.2015

Do you have any specific /rob command created yet?


Re: [Request]Robing :) - astanalol - 04.01.2015

Quote:
Originally Posted by Sid_Alexander
Посмотреть сообщение
Do you have any specific /rob command created yet?
No
i Want Somone Made it To Me Request
+Rep For Any one Help Me With My Step in UP


Respuesta: [Request]Robing :) - [CG]Milito - 04.01.2015

You will need these

SetTimer
IsPlayerInRangeOfPoint
GetPlayerInterior



Then just some if statements

Some pseudocode I quickly made

pawn Код:
if(GetPlayerInterior(playerid) == 10)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, XPOS, YPOS, ZPOS)
        {
            SetTimer(playerid,"RobberyInProgress",1000,false);
            GameTextForPlayer(playerid,"Stay in this place", 1000, -1);
        }
        else
        {
            Continue with your code, this will get called if player is not near your desired pos;
        }
    }
    forward RobberyInProgress(playerid);
    public RobberyInProgress(playerid)
    {
        This gets called when the player has started the robbery
        Continue with your code
    }



Re: [Request]Robing :) - Sid_Alexander - 04.01.2015

on top.
Код:
new robbed[MAX_PLAYERS];
forward robtimer(playerid);
forward robreset(playerid);
then:
Код:
public robtimer(playerid)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 4.0, 319.60,-220.10,0.00,104.5) && GetPlayerInterior(playerid) == 10)
	        {
	    		GivePlayerMoney(playerid, 10000);
	    		SendClientMessage(playerid, -1, "You robbed 10000$");
			}
                        else
                        {
                         SendClientMessage(playerid, -1, "Robbing failed, You left the store.");
                         }
		return 1;
	}
public robreset(playerid)
	{
		robbed[playerid] = 0;
	    SendClientMessage(playerid, -1, "You can now rob again.");
		return 1;
	}
OnPlayerCommandText:

Код:
if (strcmp("/rob", cmdtext, true, 10) == 0)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 4.0, 319.60,-220.10,0.00,104.5) && GetPlayerInterior(playerid) == 10)
	        {
	            if(robbed[playerid] == 1) return SendClientMessage(playerid, -1, "Wait 3 mins before robbing again.");
	            robbed[playerid] = 1;
	            SetTimerEx("robtimer", 30000, false, "d", playerid);
	            SetTimerEx("robreset", 180000, false, "d", playerid);
	            }
	            else
	            {
	            SendClientMessage(playerid, -1, "You're not in the store.");
	            }
		return 1;
	}



Re: [Request]Robing :) - astanalol - 04.01.2015

he is watting 30sec for road the money ?
PHP код:
if(GetPlayerInterior(playerid) == 10)
    {
        if(
IsPlayerInRangeOfPoint(playerid3.0XPOSYPOSZPOS)
        {
            
SetTimer(playerid,"RobberyInProgress",1000,false);
            
GameTextForPlayer(playerid,"Stay in this place"1000, -1);
        }
        else
        {
            if(
GetPlayerInterior(playerid) == 0)
            
GameTextForPlayer(playerid,"Robbery Failed Dude :)"1000, -1);
        }
    }
    
forward RobberyInProgress(playerid);
    public 
RobberyInProgress(playerid)
    {
        
This gets called when the player has started the robbery
        
Continue with your code
    

i made the robbery faild


Re: [Request]Robing :) - Sid_Alexander - 04.01.2015

Quote:
Originally Posted by astanalol
Посмотреть сообщение
he is watting 30sec for road the money ?
PHP код:
if(GetPlayerInterior(playerid) == 10)
    {
        if(
IsPlayerInRangeOfPoint(playerid3.0XPOSYPOSZPOS)
        {
            
SetTimer(playerid,"RobberyInProgress",1000,false);
            
GameTextForPlayer(playerid,"Stay in this place"1000, -1);
        }
        else
        {
            if(
GetPlayerInterior(playerid) == 0)
            
GameTextForPlayer(playerid,"Robbery Failed Dude :)"1000, -1);
        }
    }
    
forward RobberyInProgress(playerid);
    public 
RobberyInProgress(playerid)
    {
        
This gets called when the player has started the robbery
        
Continue with your code
    

i made the robbery faild
Check what i posted ^^


Re: [Request]Robing :) - astanalol - 04.01.2015

Quote:
Originally Posted by Sid_Alexander
Посмотреть сообщение
on top.
Код:
new robbed[MAX_PLAYERS];
forward robtimer(playerid);
forward robreset(playerid);
then:
Код:
public robtimer(playerid)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 4.0, 319.60,-220.10,0.00,104.5) && GetPlayerInterior(playerid) == 10)
	        {
	    		GivePlayerMoney(playerid, 10000);
	    		SendClientMessage(playerid, -1, "You robbed 10000$");
			}
                        else
                        {
                         SendClientMessage(playerid, -1, "Robbing failed, You left the store.");
                         }
		return 1;
	}
public robreset(playerid)
	{
		robbed[playerid] = 0;
	    SendClientMessage(playerid, -1, "You can now rob again.");
		return 1;
	}
OnPlayerCommandText:

Код:
if (strcmp("/rob", cmdtext, true, 10) == 0)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 4.0, 319.60,-220.10,0.00,104.5) && GetPlayerInterior(playerid) == 10)
	        {
	            if(robbed[playerid] == 1) return SendClientMessage(playerid, -1, "Wait 3 mins before robbing again.");
	            robbed[playerid] = 1;
	            SetTimerEx("robtimer", 30000, false, "d", playerid);
	            SetTimerEx("robreset", 180000, false, "d", playerid);
	            }
	            else
	            {
	            SendClientMessage(playerid, -1, "You're not in the store.");
	            }
		return 1;
	}
2 error i have it
Quote:

D:\sa\filterscripts\bagarab.pwn(16) : warning 202: number of arguments does not match definition
D:\sa\filterscripts\bagarab.pwn(32) : warning 202: number of arguments does not match definition

PHP код:
if(IsPlayerInRangeOfPoint(playerid4.0319.60,-220.10,0.00,104.5) && GetPlayerInterior(playerid) == 10
PHP код:
if(IsPlayerInRangeOfPoint(playerid4.0319.60,-220.10,0.00,104.5) && GetPlayerInterior(playerid) == 10



Re: [Request]Robing :) - Sid_Alexander - 04.01.2015

Код:
319.60,-220.10,0.00,104.5
This position is invalid, Type in proper co-ordinates and they will work.


Re: [Request]Robing :) - astanalol - 04.01.2015

if player leave to interior 0 robbery faild please