SA-MP Forums Archive
Rob command - 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: Rob command (/showthread.php?tid=490205)



Rob command - Blademaster680 - 25.01.2014

I am trying to make the 24/7 rob able.
The command works but the timer does not.
Here is the code:
Код:
CMD:rob(playerid, params[])
{
	if(Shop(playerid) == NOT_IN_ROB) return SendClientMessage(playerid, -1, "You cant rob this place.");
	if(Rob(playerid) == ROB_SHOP_247)
	{
	    if(PlayerInfo[playerid][pVW] ==  53434244)
	    {
	        new str[128];
	        SetTimerEx("Rob247", 3000, false, "i", playerid);
	        SendClientMessageToLSPD(COLOR_TWBLUE, "The 24/7 next to City Hall is being robbed.");
	        SendClientMessage(playerid, -1, "You are robbing the 24/7.");
	        format(str, sizeof(str), "** %s is attempting to rob the 24/7.", GetName(playerid));
	        ProxDetector(50.0, playerid, str, COLOR_PURPLE);
	    }
	}
	return 1;
}
Код:
forward Rob247(playerid);
public Rob247(playerid)
{
	if(PlayerInfo[playerid][pVW] == 5343424)
	{
	    new str[128];
		new cash = random(1900) + 600;
		PlayerInfo[playerid][pCash] += cash;
		ClearAnimations(playerid);
		format(str, sizeof(str), "You have just robbed a 24/7 earning you $%i", cash);
		SendClientMessage(playerid, -1, str);
		print("24/7 being robbed.");
		return 1;
	}
	return 1;
}



Re: Rob command - McBan - 25.01.2014

Make It Like So:

Код:
new Rob247;



Re: Rob command - Blademaster680 - 25.01.2014

If I add that it crashes my compiler...


Re: Rob command - Ranshand - 25.01.2014

In command.
Код:
if(PlayerInfo[playerid][pVW] ==  53434244)
And in timer.
Код:
if(PlayerInfo[playerid][pVW] == 5343424)
I do not know but i think this is problem.