SA-MP Forums Archive
givemoeny problem. - 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: givemoeny problem. (/showthread.php?tid=613847)



givemoeny problem. - b0b - 01.08.2016

PHP код:
CMD:givemoney(playeridparams[])
{
    new 
targetid,type,string[128];
    if(
sscanf(params"ui"targetidtype)) return SendClientMessage(playeridCOLOR_GRAD2"USAGE: {FFFFFF}/givemoney [playerid] [amount]");
    if(!
IsPlayerConnected(targetid)) return SendClientMessage(playeridCOLOR_GREY"* This player is not in server..");
    if(
type || type 99999999) return SendClientMessage(playeridCOLOR_GREY"* Cannot go under 0 or above 99999999.");
    if(
PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playeridCOLOR_GRAD1"You are not ADMIN!");
    
GivePlayerCash(targetidtype);
    
format(stringsizeof(string),"AdmCmd: %s give player %s %d SAK"RPNameplayerid ), RPNametargetid ), type);
    
SendAdminMessage(COLOR_YELLOW,string);
    return 
1;

This code..

So if i try but /givemoney 0 300 its say "This player is not in server.." Why?? if my id is 0


Re: givemoeny problem. - Shinja - 01.08.2016

PHP код:
GiveMoney(targetidtype);//not GivePlayerCash 



Re: givemoeny problem. - FuNkYTheGreat - 01.08.2016

PHP код:
CMD:givemoney(playeridparams[])
{
    new 
targetid,type,string[128];
    if(
sscanf(params"ui"targetidtype)) 
    {
    
SendClientMessage(playeridCOLOR_GRAD2"USAGE: {FFFFFF}/givemoney [playerid] [amount]");
    }
    if(!
IsPlayerConnected(targetid))
    {   
    
SendClientMessage(playeridCOLOR_GREY"* This player is not in server..");
    if(
type || type 99999999
    {
    
SendClientMessage(playeridCOLOR_GREY"* Cannot go under 0 or above 99999999.");
    }
    if(
PlayerInfo[playerid][pAdmin] < 1337
    {
    
SendClientMessage(playeridCOLOR_GRAD1"You are not ADMIN!");
    }
    
GivePlayerCash(targetidtype);
    
format(stringsizeof(string),"AdmCmd: %s give player %s %d SAK"RPNameplayerid ), RPNametargetid ), type);
    
SendAdminMessage(COLOR_YELLOW,string);
    return 
1;

if ^^ this didn't work try this
PHP код:
CMD:givemoney(playeridparams[])
{
    new 
targetid,type,string[128];
    if(
sscanf(params"ui"targetidtype)) 
    {
    
SendClientMessage(playeridCOLOR_GRAD2"USAGE: {FFFFFF}/givemoney [playerid] [amount]");
    }
    if(
iTargetID == INVALID_PLAYER_ID
    {
    
SendClientMessage(playerid, -1"» "red"Player not connected.");
    }
    if(
type || type 99999999
    {
    
SendClientMessage(playeridCOLOR_GREY"* Cannot go under 0 or above 99999999.");
    }
    if(
PlayerInfo[playerid][pAdmin] < 1337
    {
    
SendClientMessage(playeridCOLOR_GRAD1"You are not ADMIN!");
    }
    
GivePlayerCash(targetidtype);
    
format(stringsizeof(string),"AdmCmd: %s give player %s %d SAK"RPNameplayerid ), RPNametargetid ), type);
    
SendAdminMessage(COLOR_YELLOW,string);
    return 
1



Re: givemoeny problem. - b0b - 01.08.2016

Dont work


Re: givemoeny problem. - jlalt - 01.08.2016

not sure but try it
PHP код:
CMD:givemoney(playeridparams[])
{
    new 
targetid,type,string[128];
    if(
sscanf(params"di"targetidtype)) return SendClientMessage(playeridCOLOR_GRAD2"USAGE: {FFFFFF}/givemoney [playerid] [amount]");
    if(!
IsPlayerConnected(targetid)) return SendClientMessage(playeridCOLOR_GREY"* This player is not in server..");
    if(
type || type 99999999) return SendClientMessage(playeridCOLOR_GREY"* Cannot go under 0 or above 99999999.");
    if(
PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playeridCOLOR_GRAD1"You are not ADMIN!");

    
GivePlayerCash(targetidtype);
    
format(stringsizeof(string),"AdmCmd: %s give player %s %d SAK"RPNameplayerid ), RPNametargetid ), type);
    
SendAdminMessage(COLOR_YELLOW,string);
    return 
1;




Re: givemoeny problem. - b0b - 01.08.2016

Quote:
Originally Posted by jlalt
Посмотреть сообщение
not sure but try it
PHP код:
CMD:givemoney(playeridparams[])
{
    new 
targetid,type,string[128];
    if(
sscanf(params"di"targetidtype)) return SendClientMessage(playeridCOLOR_GRAD2"USAGE: {FFFFFF}/givemoney [playerid] [amount]");
    if(!
IsPlayerConnected(targetid)) return SendClientMessage(playeridCOLOR_GREY"* This player is not in server..");
    if(
type || type 99999999) return SendClientMessage(playeridCOLOR_GREY"* Cannot go under 0 or above 99999999.");
    if(
PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playeridCOLOR_GRAD1"You are not ADMIN!");
    
GivePlayerCash(targetidtype);
    
format(stringsizeof(string),"AdmCmd: %s give player %s %d SAK"RPNameplayerid ), RPNametargetid ), type);
    
SendAdminMessage(COLOR_YELLOW,string);
    return 
1;


Ty Pro it work :3 Love you


Re: givemoeny problem. - Vince - 01.08.2016

It's a workaround because "u" should work. If it doesn't then you probably haven't installed sscanf correctly.


Re: givemoeny problem. - Deadpoop - 01.08.2016

Batter to use "ui" because "u" gets ID and username and "d" gets only ID