SA-MP Forums Archive
help me my /pay <id> fs don't work - 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: help me my /pay <id> fs don't work (/showthread.php?tid=339741)



help me my /pay <id> fs don't work - speediekiller2 - 04.05.2012

hy all^^,

my pay fs doesnt work if i typed in game /pay then says the server that there is no command for it,

please help me here's the fs:

http://pastebin.com/sCBWGs7a

thnx for your help,
speediekiller2


Re: help me my /pay <id> fs don't work - JaTochNietDan - 04.05.2012

You have not added the relevant part of dcmd to the OnPlayerCommandText callback:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(pay, 3, cmdtext);
    return 0;
}
You really need to start searching and figuring things out yourself, you are creating way too many topics for such simple issues.


Re: help me my /pay <id> fs don't work - speediekiller2 - 04.05.2012

the filterscript does nothing if i put that in it


Re: help me my /pay <id> fs don't work - milanosie - 04.05.2012

Edit it to your likings,

Код:
CMD:pay(playerid, params[])
{
	new id;
	new money2;
	new Float:XX1, Float:YY1, Float:ZZ1;
	if(!sscanf(params, "ud", id, money2))
	{
	    new string[128];
	    GetPlayerPos(id, XX1, YY1, ZZ1);
		if(IsPlayerInRangeOfPoint(playerid, 5.0, XX1, YY1, ZZ1))
		{
		    if(PlayerInfo[playerid][Cash] >= money2 && money2 > 0)
		    {
		        new name[MAX_PLAYER_NAME], pname[MAX_PLAYER_NAME];
		        GetPlayerName(playerid, name, sizeof(name));
		        GetPlayerName(id, pname, sizeof(pname));
				GivePlayerMinusCash(playerid, money2);
				GivePlayerCash(id, money2);
				format(string, sizeof(string), "**%s Takes out some money and gives it to %s (($%d))", name, pname, money2);
				LocalChat(15.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
				ApplyAnimation(playerid,"DEALER","shop_pay",4.1,0,0,0,0,0);
				printf("[CMD: pay] %s Gives $%d to %s", name, pname, money2);
				return 1;
			}
			else return SendClientMessage(playerid, COLOR_GREY, "Not enough money!");
		}
		else return SendClientMessage(playerid, COLOR_GREY, " You are not near the other player! ");
	}
	else return SendClientMessage(playerid, COLOR_GREY, " UASGE: /pay [Player ID/ PlayerName] [Ammount] ");
}



Re: help me my /pay <id> fs don't work - speediekiller2 - 04.05.2012

it doesnt still work :S but thnx for your help^^


Re: help me my /pay <id> fs don't work - ViniBorn - 04.05.2012

Delete this and read the JaTochNietDan's post

pawn Код:
//#define FILTERSCRIPT

#if defined FILTERSCRIPT

#endif



- speediekiller2 - 04.05.2012

ive did that too but it still doen't work but thnx for help

IVE GOT IT THNX ALL!