givemoeny problem.
#1

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
Reply
#2

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

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
Reply
#4

Dont work
Reply
#5

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;

Reply
#6

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
Reply
#7

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)