/pay help
#1

hey, can somone help me with this, im so confused, i go in game type /pay to my id just to test it but it just pays 0 to me as the id i am

Код HTML:
if (strcmp("/pay", cmd, true) == 0)
	{
	    tmp = strtok(cmdtext, idx);
		if(strlen(tmp) == 0) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /pay [player id][amount]");
 		new playeree = strval(tmp);
 		new playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME];
		GetPlayerName(playeree, playername, MAX_PLAYER_NAME);
		GetPlayerName(playerid, adminname, MAX_PLAYER_NAME);
 		if(!IsPlayerConnected(playeree)) return SendClientMessage(playerid, COLOR_WHITE, "Player is not connected.");

        new tmp2[128];
		new ammount = strval(tmp2);
		if(ammount >= 0 && ammount <= 99999999)

		if(GetPlayerMoney(playerid) < ammount) return SendClientMessage(playerid, COLOR_ROYALBLUE, "You don't have enough cash.");

		new Float:x, Float:y, Float:z;
		    
		GetPlayerPos(playeree, x, y, z);
		
		if(IsPlayerInRangeOfPoint(playerid, 30, x, y, z))
		{
			format(string, sizeof(string), "%s Has Payed You $%i",adminname, ammount);
			SendClientMessage(playeree, COLOR_RED, string);
			format(string, sizeof(string), "You Have Payed %s $%i", playername, ammount);
			SendClientMessage(playerid, COLOR_RED, string);
			GivePlayerMoney(playeree, ammount);
		}

		for(new i = 0; i < MAX_PLAYERS; i++)

		if(IsPlayerInRangeOfPoint(i, 30, x, y, z))
		{
			format(string, sizeof(string), "%s has give some cash to %s", adminname, playername);
			SendClientMessage(i ,COLOR_PINK, string);
		}

		return 1;
	}
Reply
#2

Try testing it with other players, its kinda stupid doing it to yourself
(PM me IP now and i'll help you test )
Reply
#3

still need help with this
Reply
#4

Why dont you use ZCMD, which is more easier to use and a faster command processor.
Reply
#5

cause i dont wanna have to relearn all the functions and this is fast enogh for what i use
Reply
#6

bump
Reply
#7

Change this
PHP код:
GivePlayerMoney(playereeammount); 
to this
PHP код:
GivePlayerMoney(playeridammount); 
Reply
#8

umm im not trying to pay myself, my money needs to go to my target id
Reply
#9

Just test it if it works.
Reply
#10

it wont work, i dont even need to compile it, cause paying my self wont work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)