SA-MP Forums Archive
What happend Here? Pawno has stopped working??? - 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: What happend Here? Pawno has stopped working??? (/showthread.php?tid=624532)



What happend Here? Pawno has stopped working??? - RedRex - 18.12.2016

Hi everyone is there any Error with my codes? Because I make a command and when I try to Save it The Pawno stopped Working Why? Can you help me ? Please?

Command of Robbery!.... Is there any error? If you want the Timer code i'll give you it.
Код:
CMD:robdrag(playerid, params[]) //Command robbank
{
	if(!IsPlayerInDynamicCP(playerid, CP_Robdrag)) return SendClientMessage(playerid, COLOR_RED, "You must be in Checkpoint");
	{
		if(Robdragrobbedrecently >=1)//Checking if Four Dragon Casino has been Robbed Recently..
		{
			SendClientMessage(playerid, COLOR_RED, "[ROBBERY]: Four Dragon has been Robbed Recently");
		}
		ROBBING_Robdrag[playerid] = 60;
		Robdragrobbedrecently =200;
	}
    return 1;
}



Re: What happend Here? Pawno has stopped working??? - QuaTTrO - 18.12.2016

Код:
CMD:robdrag(playerid, params[]) //Command robbank
{
	if(IsPlayerInDynamicCP(playerid, CP_Robdrag))
	{
		if(Robdragrobbedrecently >=1)//Checking if Four Dragon Casino has been Robbed Recently..
		{
			SendClientMessage(playerid, COLOR_RED, "[ROBBERY]: Four Dragon has been Robbed Recently");
		}
		ROBBING_Robdrag[playerid] = 60;
		Robdragrobbedrecently =200;
	}else SendClientMessage(playerid, COLOR_RED, "You must be in Checkpoint");
    return 1;
}
You can't do that
Код:
if(!IsPlayerInDynamicCP(playerid, CP_Robdrag)) return SendClientMessage(playerid, COLOR_RED, "You must be in Checkpoint");
{
Because there is code already after IF instruction. What you were trying to do is call one function outside brackets and then another function in another bracket


Re: What happend Here? Pawno has stopped working??? - RedRex - 18.12.2016

Quote:
Originally Posted by QuaTTrO
Посмотреть сообщение
Код:
CMD:robdrag(playerid, params[]) //Command robbank
{
	if(IsPlayerInDynamicCP(playerid, CP_Robdrag))
	{
		if(Robdragrobbedrecently >=1)//Checking if Four Dragon Casino has been Robbed Recently..
		{
			SendClientMessage(playerid, COLOR_RED, "[ROBBERY]: Four Dragon has been Robbed Recently");
		}
		ROBBING_Robdrag[playerid] = 60;
		Robdragrobbedrecently =200;
	}else SendClientMessage(playerid, COLOR_RED, "You must be in Checkpoint");
    return 1;
}
Hello, I thing its worked but 100% I Thing the Problem with The Timer... Can you check if there any Error?

Код:
forward RobdragRobbery();
public RobdragRobbery();
{
  for(new i=0; i<MAX_PLAYERS; i++)
  {
	  if(IsPlayerConnected(i)) //Checking if a player connected to server!!
	  {
		 //ROBBERIES
		 if(ROBBING_Robdrag[i] >1) //Checking if robbery time above 1
		 {
			 ROBBING_Robdrag[i] --; //Decresting time
			 new time[20];
			 format(time,sizeof(time,"~w~DO NOT ~g~LEAVE CHECKPOINT\n~r~ROBBERY TIME:%d",ROBBING_Robdrag[i]);
			 SetPlayerWantedLevel(i, GetPlayerWantedLevel(i) + 4); //Given the Player 4 WANTED LEVEL
			 GameTextForPlayer(i, time,500,3);
		 }
		 if(ROBBING_Robdrag[i] == 1) //If the timer reached 1
		 {
			 new string[64], pName[MAX_PLAYER_NAME]; //Getting player name
			 GetPlayerName(i,Pname,MAX_PLAYER_NAME);
			 SendClientMessage(i, COLOR_GREEN, "Robbery Completed");
			 ROBBING_Robdrag[i] =0; //Reset Timer
			 new mrand =random(150000);
			 format(string,sizeof(string), "[4D Robbery]: %s(%d) has been robbed 4D, Total of $%d From 4D!",pName,i,mrand);
			 SendClientMessageToAll(COLOR_RED,string);
			 
			 GivePlayerMoney(i, mrand);
		 }

	  }
  }
  return 1;
}



Re: What happend Here? Pawno has stopped working??? - QuaTTrO - 18.12.2016

Can you post a error here?


Re: What happend Here? Pawno has stopped working??? - RedRex - 18.12.2016

Quote:
Originally Posted by QuaTTrO
Посмотреть сообщение
Can you post a error here?
Error? How to I can post it? I Told you man I cant Save it When I TRIED To F5 Pawno stopped working....


Re: What happend Here? Pawno has stopped working??? - QuaTTrO - 18.12.2016

Код:
public RobdragRobbery()
Don't put ; in callbacks. Semicolon is required only in forward


Re: What happend Here? Pawno has stopped working??? - RedRex - 18.12.2016

WOW Thanks help me with this error

Код:
error 001: expected token: ")", but found ","
error 001: expected token: ",", but found "-string-"
Line

PHP код:
format(time,sizeof(time)"~w~DO NOT ~g~LEAVE CHECKPOINT\n~r~ROBBERY TIME:%d",ROBBING_Robdrag[i]); 



Re: What happend Here? Pawno has stopped working??? - daghost111 - 18.12.2016

....................


Re: What happend Here? Pawno has stopped working??? - CutX - 18.12.2016

Quote:
Originally Posted by RedRex
Посмотреть сообщение
WOW Thanks help me with this error

Код:
error 001: expected token: ")", but found ","
error 001: expected token: ",", but found "-string-"
Line

PHP код:
format(time,sizeof(time)"~w~DO NOT ~g~LEAVE CHECKPOINT\n~r~ROBBERY TIME:%d",ROBBING_Robdrag[i]); 
" expected token: ",", but found "-string-"" -pretty straight forward

missing a comma after sizeof(time)

Код:
format(time,sizeof(time),"~w~DO NOT ~g~LEAVE CHECKPOINT\n~r~ROBBERY TIME:%d",ROBBING_Robdrag[i]);



Re: What happend Here? Pawno has stopped working??? - RedRex - 18.12.2016

EDITED: I got errors

Код:
C:\Users\RedRe\Desktop\SAMMP\gamemodes\Checkpoints.pwn(324) : error 001: expected token: ",", but found "-string-"
C:\Users\RedRe\Desktop\SAMMP\gamemodes\Checkpoints.pwn(324) : warning 215: expression has no effect
C:\Users\RedRe\Desktop\SAMMP\gamemodes\Checkpoints.pwn(324) : warning 215: expression has no effect
C:\Users\RedRe\Desktop\SAMMP\gamemodes\Checkpoints.pwn(324) : error 001: expected token: ";", but found ")"
C:\Users\RedRe\Desktop\SAMMP\gamemodes\Checkpoints.pwn(324) : error 029: invalid expression, assumed zero
C:\Users\RedRe\Desktop\SAMMP\gamemodes\Checkpoints.pwn(324) : fatal error 107: too many error messages on one line
This all ERRORS at this line