cmd givemoney
#1

hey guys i make a command for give money no errors but command dont work when i type /givemoney playerid 1 it dont give me any amount help
code
Код:
CMD:givemoney(playerid,params[])
{
if(IsPlayerAdmin(playerid) < 1) return SendClientMessage(playerid, 0x33AA33AA, "[BA:RP]Niste Ovlasceni!");
 new targetid;
 new value;
 {
   if(sscanf(params, "d", targetid, value)) return SendClientMessage(playerid, 0x33AA33AA, "[BA:RP]Koristi /givemoney [playerid] [money]");
	{
	  if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0x33AA33AA, "[BA:RP]Igrac nije online!");
	    {
 	      if(IsPlayerAdmin(targetid) < 1)return SendClientMessage (playerid, 0x33AA33AA, "[BA:RP]Niste Ovlasceni!");
	    GivePlayerMoney(playerid, value);
	    }
	   }
	  }
	return 1;
      }
Reply
#2

PHP код:
if(sscanf(params"ud"targetidvalue)) 
Reply
#3

CMD:givemoney(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0x33AA33AA, "[BA:RP]Niste Ovlasceni!");
new targetid;
new value;
{
if(sscanf(params, "ud", targetid, value)) return SendClientMessage(playerid, 0x33AA33AA, "[BA:RP]Koristi /givemoney [playerid] [money]");
{
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0x33AA33AA, "[BA:RP]Igrac nije online!");
{
GivePlayerMoney(targetid, value);
}
}
}
return 1;
}

Try it.
Reply
#4

You guys should check his code before replying. You use IsPlayerAdmin wrong. IT only checks for Rcon admin. It doesn't have any level. Then, Once you return something, That if is closed. You don't have to go on opening the brackets again.

This should work

PHP код:
CMD:givemoney(playerid,params[])
{
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid0x33AA33AA"[BA:RP]Niste Ovlasceni!");
    new 
targetidvalue;
    if(
sscanf(params"ud"targetidvalue)) return SendClientMessage(playerid0x33AA33AA"[BA:RP]Koristi /givemoney [playerid] [money]");
    if(!
IsPlayerConnected(targetid)) return SendClientMessage(playerid0x33AA33AA"[BA:RP]Igrac nije online!");
    if(
IsPlayerAdmin(targetid))return SendClientMessage (playerid0x33AA33AA"[BA:RP]Niste Ovlasceni!");
    
GivePlayerMoney(targetidvalue);
    return 
1;
   

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)