Convert
#6

Quote:
Originally Posted by AndySedeyn
Посмотреть сообщение
Why are you promoting the use of even more deprecated, outdated and inefficient functions than OnPlayerCommandText? Sure, it's good to know about them, but the use of them should be avoided at all times!

Use this:
PHP код:
public OnPlayerCommandText(playeridcmdtext[]) {
    if(!
strcmp(cmdtext"transfer"true)) {
        new
            
id,
            
amount,
            
cash;
        if(
sscanf(params,"ui"idamount)) 
            return 
SendClientMessage(playerid0xCECECEFF"CMD: /transfer [player] [amount]"); 
        if(!
IsPlayerConnected(id)) 
            return 
SendClientMessage(playerid0xCECECEFF"Player is not connected"); 
        
cash GetPlayerMoney(playerid); 
        if(
amount cash
            return 
SendClientMessage(playerid0xCECECEFF"You do not have that much!"); 
        if(
amount 1
            return 
SendClientMessage(playerid0xCECECEFF"You can not transfer funds under 1!"); 
        
GivePlayerMoney(playerid, -amount); 
        
GivePlayerMoney(idamount); 
        
SendClientMessage(playerid0xCECECEFF"You sent the money."); 
        
SendClientMessage(id0xCECECEFF"You got given money.");
        return 
1;
    }
    return 
0;

If you would have read what his topic said, you would have know why I used that I even said on my comment that he shouldn't use them: Just to let you know, ZCMD is faster than strcmp.

So please open your eyes before posting something.
Reply


Messages In This Thread
Convert - by aimane65 - 03.01.2016, 15:21
Re: Convert - by Lucky13 - 03.01.2016, 15:37
Re: Convert - by aimane65 - 03.01.2016, 16:10
Re: Convert - by Lucky13 - 03.01.2016, 16:13
Re: Convert - by AndySedeyn - 03.01.2016, 16:18
Re: Convert - by Lucky13 - 03.01.2016, 16:21
Re: Convert - by aimane65 - 03.01.2016, 16:29

Forum Jump:


Users browsing this thread: 2 Guest(s)