SA-MP Forums Archive
Give money to player on checkpoint problem - 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: Give money to player on checkpoint problem (/showthread.php?tid=409661)



Give money to player on checkpoint problem - William1122 - 22.01.2013

I have a RP gamemode and the drug smuggler job is bugging a bit, when you arrive at the checkpoint to deliver the crates you bought, the checkpoint dissappears but you get no money, according to the level you have on drug smuggler, and you keep the crate. Anyone know what's wrong with this code? Or maybe the problem is somewhere else. Reply if you need anything more:

Код:
		if(Points[h][Type] == 3 && GetPVarInt(playerid, "CrateDeliver") == 1 && IsPlayerInRangeOfPoint(playerid, 6.0, 2166.3772,-1675.3829,15.0859))
		{
			new string[128];
		    if(GetPVarInt(playerid, "tpDrugRunTimer") != 0)
	    	{
			   	format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is possibly teleport drugrunning.", GetPlayerNameEx(playerid), playerid);
			   	ABroadCast( COLOR_YELLOW, string, 2 );
			   	format(string, sizeof(string), "%s (ID %d) is possibly teleport drugrunning.", GetPlayerNameEx(playerid), playerid);
			   	Log("logs/hack.log", string);
			}
			DisablePlayerCheckpoint(playerid);
			new level = PlayerInfo[playerid][pSmugSkill];
   			if(level >= 0 && level <= 20)
			{
			    SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You received $1250 for delivering the Drug Crates.");
				GivePlayerCash(playerid, 1250);
			}
			else if(level >= 21 && level <= 50)
			{
			    SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You received $1500 for delivering the Drug Crates.");
				GivePlayerCash(playerid, 1500);
			}
			else if(level >= 51 && level <= 100)
			{
			    SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You received $2000 for delivering the Drug Crates.");
				GivePlayerCash(playerid, 2000);
			}
			else if(level >= 101 && level <= 200)
			{
			    SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You received $3000 for delivering the Drug Crates.");
				GivePlayerCash(playerid, 3000);
			}
			else if(level >= 201)
			{
			    SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You received $4000 for delivering the Drug Crates.");
				GivePlayerCash(playerid, 4000);
			}
			DeletePVar(playerid, "CrateDeliver");
			PlayerInfo[playerid][pCrates] = 0;
			Points[h][Stock] += 10;
			PlayerInfo[playerid][pSmugSkill]++;
			format(string, sizeof(string), " POT AVAILABLE: %d/1000.", Points[h][Stock]);
			UpdateDynamic3DTextLabelText(Points[h][TextLabel], COLOR_YELLOW, string);
			return 1;
		}
		else if(Points[h][Type] == 4 && GetPVarInt(playerid, "CrateDeliver") == 2 && IsPlayerInRangeOfPoint(playerid, 6.0, 2354.2808,-1169.2959,28.0066))
		{
			new string[128];
		    if(GetPVarInt(playerid, "tpDrugRunTimer") != 0)
	    	{
			   	format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is possibly teleport drugrunning.", GetPlayerNameEx(playerid), playerid);
			   	ABroadCast( COLOR_YELLOW, string, 2 );
			   	format(string, sizeof(string), "%s (ID %d) is possibly teleport drugrunning.", GetPlayerNameEx(playerid), playerid);
			   	Log("logs/hack.log", string);
			}
			DisablePlayerCheckpoint(playerid);
			new level = PlayerInfo[playerid][pSmugSkill];
			if(level >= 0 && level <= 20)
			{
			    SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You received $1250 for delivering the Drug Crates.");
				GivePlayerCash(playerid, 1250);
			}
			else if(level >= 21 && level <= 50)
			{
			    SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You received $1500 for delivering the Drug Crates.");
				GivePlayerCash(playerid, 1500);
			}
			else if(level >= 51 && level <= 100)
			{
			    SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You received $2000 for delivering the Drug Crates.");
				GivePlayerCash(playerid, 2000);
			}
			else if(level >= 101 && level <= 200)
			{
			    SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You received $3000 for delivering the Drug Crates.");
				GivePlayerCash(playerid, 3000);
			}
			else if(level >= 201)
			{
			    SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You received $4000 for delivering the Drug Crates.");
				GivePlayerCash(playerid, 4000);
			}
			DeletePVar(playerid, "CrateDeliver");
			PlayerInfo[playerid][pCrates] = 0;
			Points[h][Stock] += 10;
			PlayerInfo[playerid][pSmugSkill]++;
			format(string, sizeof(string), " CRACK AVAILABLE: %d/1000.", Points[h][Stock]);
			UpdateDynamic3DTextLabelText(Points[h][TextLabel], COLOR_YELLOW, string);
			return 1;
		}
Thank you for the help in advance


Respuesta: Give money to player on checkpoint problem - William1122 - 22.01.2013

Still up


Respuesta: Give money to player on checkpoint problem - William1122 - 23.01.2013

is it such a big problem in my script no one knows how?


Re: Give money to player on checkpoint problem - FUNExtreme - 23.01.2013

Does it show the messages that come with the money?


Re: Give money to player on checkpoint problem - LScripter - 23.01.2013

Maybe there is problem with the disappearing of the checkpoint which is not giving the player money.


Respuesta: Give money to player on checkpoint problem - William1122 - 23.01.2013

No it does not show any message, When you enter the checkpoint, The checkpoint dissappears and you get nothing, You just keep the crate.

Well LScripter i kinda figured that out :P But I need to know what, Thanks for the help tough Both of you


Respuesta: Give money to player on checkpoint problem - William1122 - 24.01.2013

Well I see no one knows any solution I give up..