Jump to content
  • 0

Problema Rob


HasH

Question

Problema intalnita (descriere):Salut , am si eu o problema legata de rob , cand ma duc in banca si dau rob imi apare un mesaj "

You are now robbing the business, wait 10 seconds to take the money!"

Si ramane asa nu se mai intampla nimic stau si o ora si raman blocat
Ero(area / rile) / warning-(ul / urile): -
Liniile de cod / sursa / script-ul

CMD:rob(playerid, params[])
{
	if(playerVariables[playerid][pWarrants] == 0)
	{
		if(playerVariables[playerid][pDonate] == 0)
		{
			if(playerVariables[playerid][pRobPoints] >= 10)
			{
				if((InBizz[playerid] >= 1) && (GetPlayerVirtualWorld(playerid) - BUSINESS_VIRTUAL_WORLD == InBizz[playerid]))
				{
					if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] != 1)
					{
						playerVariables[playerid][pRobPoints] -= 10;
						RobTime[playerid] = 11;
						SCM(playerid, COLOR_LIGHTBLUE, "You are now robbing the business, wait 10 seconds to take the money!");
						playerVariables[playerid][pRob] = 1;
						TogglePlayerControllable(playerid, 0);
						playerVariables[playerid][pFreezeTime] = -1;
						playerVariables[playerid][pFreezeType] = 3;
					}
				}
			}
		}
		else if(playerVariables[playerid][pDonate] == 1)
		{
			if(playerVariables[playerid][pRobPoints] >= 8)
			{
				if((InBizz[playerid] >= 1) && (GetPlayerVirtualWorld(playerid) - BUSINESS_VIRTUAL_WORLD == InBizz[playerid]))
				{
					if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] != 1)
					{
						playerVariables[playerid][pRobPoints] -= 8;
						RobTime[playerid] = 11;
						SCM(playerid, COLOR_LIGHTBLUE, "You are now robbing the business, wait 10 seconds to take the money!");
						playerVariables[playerid][pRob] = 1;
						TogglePlayerControllable(playerid, 0);
						playerVariables[playerid][pFreezeTime] = -1;
						playerVariables[playerid][pFreezeType] = 3;
					}
				}
			}
		}
		else SendClientMessage(playerid, COLOR_GREY, "You don't have enough rob points.");
	}
	else SendClientMessage(playerid, COLOR_GREY, "You can't rob the bank because you are a wanted player.");
	return 1;
}
if(RobTime[x] > 0)
		{
				RobTime[x]--;
				if(RobTime[x] == 1)
				{
					new house;
					house = random(systemVariables[houseCount]);
					SetPlayerCheckpoint(x, houseVariables[house][hHouseExteriorPos][0], houseVariables[house][hHouseExteriorPos][1], houseVariables[house][hHouseExteriorPos][2], 5.0);
					new randamount;
					randamount = 50000 * playerVariables[x][pLevel];
					RobPrice[x] = randamount;
					playerVariables[x][pCheckpoint] = 8;
					SCM(x, COLOR_LIGHTBLUE, "Go to the checkpoint to receive your money!");
					new wanted;
					wanted = random(10);
					if(wanted == 1)
					{
						SCM(x, COLOR_LIGHTBLUE, "The bank employees didn't see your face. You are not wanted!");
					}
					else
					{
						playerVariables[x][pWarrants] = 6;
						format(playerVariables[x][pCrimeReason], 150, "%sarmed robberyn", playerVariables[x][pCrimeReason]);
						SetPlayerWantedLevel(x, 6);
						format(szMessage, sizeof(szMessage), "Dispatch: %s (%d) has comitted a crime: armed robbery. Reporter: unknown. W: +6 | New Wanted Level: %d", playerVariables[x][pNormalName], x,playerVariables[x][pWarrants]);
						sendDepartmentMessage(COLOR_RADIOCHAT, szMessage);
					}
					SetPlayerAttachedObject(x, 2, 1550, 1, -0.004022, -0.191353, -0.034982, 158.161407, 87.838058, 0.000000, 1.000000, 1.000000, 1.000000 );
					playerVariables[x][pFreezeTime] = 0;
					playerVariables[x][pFreezeType] = 0;
					TogglePlayerControllable(x, 1);
				}
		}
Link to comment
Share on other sites

16 answers to this question

Recommended Posts

  • 0

Poate oi fi chior , dar eu unul nu vad nici-un SetTimer sau SetTimerEx

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

  • 0

Pentru a trece cele 10 secunde de asteptare, ai nevoie de un timer (ceea ce a vrut sa te faca sa intelegi si Ph0eniX)

Pentru ca sa te putem ajuta avem nevoie de tot sistemul. Te rog sa il postezi in PasteBin sau intr-un folder cu link de download.

242086.png

Link to comment
Share on other sites

  • 0

Tu asta :

if(RobTime[x] > 0)
		{
				RobTime[x]--;
				if(RobTime[x] == 1)
				{
					new house;
					house = random(systemVariables[houseCount]);
					SetPlayerCheckpoint(x, houseVariables[house][hHouseExteriorPos][0], houseVariables[house][hHouseExteriorPos][1], houseVariables[house][hHouseExteriorPos][2], 5.0);
					new randamount;
					randamount = 50000 * playerVariables[x][pLevel];
					RobPrice[x] = randamount;
					playerVariables[x][pCheckpoint] = 8;
					SCM(x, COLOR_LIGHTBLUE, "Go to the checkpoint to receive your money!");
					new wanted;
					wanted = random(10);
					if(wanted == 1)
					{
						SCM(x, COLOR_LIGHTBLUE, "The bank employees didn't see your face. You are not wanted!");
					}
					else
					{
						playerVariables[x][pWarrants] = 6;
						format(playerVariables[x][pCrimeReason], 150, "%sarmed robberyn", playerVariables[x][pCrimeReason]);
						SetPlayerWantedLevel(x, 6);
						format(szMessage, sizeof(szMessage), "Dispatch: %s (%d) has comitted a crime: armed robbery. Reporter: unknown. W: +6 | New Wanted Level: %d", playerVariables[x][pNormalName], x,playerVariables[x][pWarrants]);
						sendDepartmentMessage(COLOR_RADIOCHAT, szMessage);
					}
					SetPlayerAttachedObject(x, 2, 1550, 1, -0.004022, -0.191353, -0.034982, 158.161407, 87.838058, 0.000000, 1.000000, 1.000000, 1.000000 );
					playerVariables[x][pFreezeTime] = 0;
					playerVariables[x][pFreezeType] = 0;
					TogglePlayerControllable(x, 1);
				}
		}

trebuie sa il pui intr-un timer care se repeta din secunda in secunda.

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Link to comment
Share on other sites

  • 0
public TimeForRob()
{
    for(new x= 0; x < MAX_PLAYERS; x++)
{
if(IsPlayerConnected(i))
{
//aici functia ta
}
}
}
 
Iar la ongamemodeinit pui SetTimer("TimerForRob", 1000, 1);
 
 
SetTimer("numelefunctiei", cate milisecunde(1000 ms = 1 secunda), daca se repeta (1- da, 0 - nu));
Edited by Gireada

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Link to comment
Share on other sites

  • 0
public TimeForRob()
{
      for(new x= 0; x < MAX_PLAYERS; x++)
    {
   if(IsPlayerConnected(x))
{
if(RobTime[x] > 0)
		{
				RobTime[x]--;
				if(RobTime[x] == 1)
				{
					new house;
					house = random(systemVariables[houseCount]);
					SetPlayerCheckpoint(x, houseVariables[house][hHouseExteriorPos][0], houseVariables[house][hHouseExteriorPos][1], houseVariables[house][hHouseExteriorPos][2], 5.0);
					new randamount;
					randamount = 50000 * playerVariables[x][pLevel];
					RobPrice[x] = randamount;
					playerVariables[x][pCheckpoint] = 8;
					SCM(x, COLOR_LIGHTBLUE, "Go to the checkpoint to receive your money!");
					new wanted;
					wanted = random(10);
					if(wanted == 1)
					{
						SCM(x, COLOR_LIGHTBLUE, "The bank employees didn't see your face. You are not wanted!");
					}
					else
					{
						playerVariables[x][pWarrants] = 6;
						format(playerVariables[x][pCrimeReason], 150, "%sarmed robberyn", playerVariables[x][pCrimeReason]);
						SetPlayerWantedLevel(x, 6);
						format(szMessage, sizeof(szMessage), "Dispatch: %s (%d) has comitted a crime: armed robbery. Reporter: unknown. W: +6 | New Wanted Level: %d", playerVariables[x][pNormalName], x,playerVariables[x][pWarrants]);
						sendDepartmentMessage(COLOR_RADIOCHAT, szMessage);
					}
					SetPlayerAttachedObject(x, 2, 1550, 1, -0.004022, -0.191353, -0.034982, 158.161407, 87.838058, 0.000000, 1.000000, 1.000000, 1.000000 );
					playerVariables[x][pFreezeTime] = 0;
					playerVariables[x][pFreezeType] = 0;
					TogglePlayerControllable(x, 1);
				    }
		     }
            }
            }
	   }
gamemodesgm.pwn(23275) : error 029: invalid expression, assumed zero
gamemodesgm.pwn(23275) : error 004: function "TimeForRob" is not implemented
gamemodesgm.pwn(23277) : warning 219: local variable "x" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
 
 
2 Errors.
 
 
23275 - public TimeForRob()
Probabil este de la forward dar l-am pus
23277 - for(new x= 0; x < MAX_PLAYERS; x++)
 
Link to comment
Share on other sites

  • 0
gamemodesgmi.pwn(23275) : error 029: invalid expression, assumed zero
gamemodesgmi.pwn(23275) : error 004: function "TimeForRob" is not implemented
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.

linia public TimeForRob()

 

Am pus forward la inceput 

forward TimeForRob()

Link to comment
Share on other sites

  • 0

Incearca asa:

stock TimeForRob2()
{
...

si in OnGameModeInit() (sau OnFilterScriptInit() - in cazul in care e un FS) pui asta precum ti-a zis si gireada:

SetTimer("TimerForRob2", 1000, 1);
Edited by (SE)KnowN

242086.png

Link to comment
Share on other sites

  • 0
gamemodesgmi.pwn(23275) : error 029: invalid expression, assumed zero
gamemodesgmi.pwn(23275) : error 004: function "TimeForRob2" is not implemented
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.

Tot asa imi da

Linia stock TimeForRob2()

am pus si la inceput forward TimeForRob2();

 
Link to comment
Share on other sites

  • 0

Sau mai simplu încearcă cu un alt nume de , ex: TFR ( TimerForRob ) dacă îţi va da la fel laşi reply sau faci ce a spus Gireada.

 

 

EDIT: Topic inchis, 48h fara reply.

Edited by Ph0eniX
public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.