/givecash don't work.
#1

pawn Код:
CMD:givecash(playerid, params[])
{
    new targetid, ammount;
    if(sscanf(params,"ui", targetid)) return SendClientMessage(playerid, 0xFFFFFFF,"Syntax error.Correct usage: /givemoney [PlayerID] ammount");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFF,"That player is not connected to the server!");
    GivePlayerMoney(targetid, ammount);
    GivePlayerMoney(playerid, -ammount);
    return 1;
}
Reply
#2

pawn Код:
CMD:givecash(playerid, params[])
{
    new targetid, ammount;
    if(sscanf(params,"ui", targetid, ammount)) return SendClientMessage(playerid, 0xFFFFFFF,"Syntax error.Correct usage: /givemoney [PlayerID] ammount");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFF,"That player is not connected to the server!");
    GivePlayerMoney(targetid, ammount);
    GivePlayerMoney(playerid, -ammount);
    return 1;
}
Try this.
Reply
#3

pawn Код:
CMD:givecash(playerid, params[])
{
    new targetid, ammount;
    if(sscanf(params,"ui", targetid, ammount)) return SendClientMessage(playerid, 0xFFFFFFF,"Syntax error.Correct usage: /givemoney [PlayerID] ammount");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFF,"That player is not connected to the server!");
    GivePlayerMoney(targetid, ammount);
    new pmoney;
    GetPlayerMoney(playerid, pmoney);
    SetPlayerMoney(playerid, (pmoney - ammount));
    return 1;
}
Reply
#4

Its shows like this:
Reply
#5

pawn Код:
COMMAND:setmoney(playerid, params[])
{
    new targetid, amount;
    if(sscanf(params, "ui", targetid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setmoney [PlayerID/Name] [Amount]");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, "The player isn't connected!");
    {
        GivePlayerMoney(targetid, amount);
        return 1;
    }
}
Compiled and tested.
Reply
#6

The Same.
Reply
#7

pawn Код:
CMD:givecash(playerid,params[])
{
   new id,cash,name[MAX_PLAYER_NAME],lol[128];
   if(sscanf(params,"ui",id,cash)) return SendClientMessage(playerid,-1,"/givecash [id] [amount] ");
   GetPlayerMoney(playerid);
   GivePlayerMoney(playerid, - cash);
   GetPlayerMoney(id);
   GivePlayerMoney(id,cash);
   GetPlayerName(playerid,name,sizeof(name));
   format(lol,sizeof(lol),"%s gave to %s the amount of cash: %i",name,name,cash);
   SendClientMessageToAll(-1,lol);

   return 1;
}
Reply
#8

Код:
COMMAND:givecash(playerid, params[])
{
    new string[256], type, targetid;
    if(sscanf(params, "ui", targetid, type)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /givecash [PlayerID/PartOfName] [Amount]");
	else
	{
		if(GetPlayerMoney(playerid) >= type)
		{
		    GivePlayerMoney(targetid, type);
		    GivePlayerMoney(playerid, -type);
		}
	 	else SendClientMessage(playerid, COLOR_GREY, "SERVER: You do have this amount of money.");
	}
	return 1;
}
Reply
#9

pawn Код:
if(sscanf(params,"ui", targetid)) return SendClientMessage(playerid, 0xFFFFFFF,"Syntax error.Correct usage: /givemoney [PlayerID] ammount");
This is your error.

Change this to
pawn Код:
if(sscanf(params,"ui", targetid,amount)) return SendClientMessage(playerid, 0xFFFFFFF,"Syntax error.Correct usage: /givemoney [PlayerID] ammount");
Reply
#10

The same its dosn't work in pawno its give me warning:
Код:
C:\DOCUME~1\admin\Desktop\NEWFOL~1\GAMEMO~1\n.pwn(885) : warning 203: symbol is never used: "givecash"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)