Convert
#5

Quote:
Originally Posted by Lucky13
Посмотреть сообщение
What errors? You have to add everything I pasted you, not only the OnPlayerCommandText.
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;

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: 1 Guest(s)