help please!
#3

Well, its because the message that was sent to the cmd user (Admin) wasn't formatted. You only formatted the message that was sent to the target player. Also, i saw that you have fetched target player's name but didn't utilize it at all.

PHP код:
CMD:givescore(playeridparams[])
{
    if(!
IsPlayerAdmin(playerid))
        return 
SendClientMessage(playeridCOLOR_ERROR"[ERROR]: You are not an admin!");

    new 
targetidscore;
    
    if(
sscanf(params"ud"targetidscore))
        return 
SendClientMessage(playeridCOLOR_ERROR"[ERROR]: Usage /givescore [playerid] [amount]");

    if(
targetid == INVALID_PLAYER_ID)
        return 
SendClientMessage(playeridCOLOR_ERROR"[ERROR]: Player is not connected.");

    new 
str[75], pname[MAX_PLAYER_NAME];
    
GetPlayerName(targetidpnameMAX_PLAYER_NAME);
    
    
SetPlayerScore(targetidGetPlayerScore(targetid) + score);
    
    
format(strsizeof(str), "Admin has given you %d score."score);
    
SendClientMessage(targetidCOLOR_PURPLEstr);
    
    
format(strsizeof(str), "you have given %d score to %s(%d)"scorepnametargetid);
    
SendClientMessage(playeridCOLOR_YELLOWstr);
    return 
1;

Reply


Messages In This Thread
help please! - by ahameed4755 - 05.10.2015, 18:39
Re: help please! - by XBrianX - 05.10.2015, 18:51
Re: help please! - by Sjn - 05.10.2015, 18:55
Re: help please! - by ahameed4755 - 05.10.2015, 19:09

Forum Jump:


Users browsing this thread: 1 Guest(s)