Client message not working
#1

Uhm, the command works, and it shows that you have setted someone something, but doesnt display the message to player that received it.
Код:
CMD:setvip(playerid, params[])
{
    new pID, value;
    if(PlayerInfo[playerid][pAdminLevel] >= 4)
    {
	    if(sscanf(params, "ui", pID, value)) return SendClientMessage(playerid, -1, "Usage: /setvip (id) (level)");
	    else if(value < 0 || value > 3) return SendClientMessage(playerid, -1, "Only levels 0-3");
	    else if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Player Is Not Currently Connected");
	    else
	    {
	        new string[128], string1[128], target[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME];
	        GetPlayerName(playerid, pName, sizeof(pName));
	        GetPlayerName(pID, target, sizeof(target));
	        format(string, sizeof(string), "You have set %s Vip Level to %i", target, value);
	        SendClientMessage(playerid, -1, string);
	        format(string, sizeof(string), "Your VIP level has been set to %i by %s", value, pName);
	        SendClientMessage(pID, -1, string1);
	        PlayerInfo[pID][pVIPlevel] = value;
	    }
	}
    return 1;
}
Reply
#2

pawn Код:
CMD:setvip(playerid, params[])
{
    new pID, value;
    if(PlayerInfo[playerid][pAdminLevel] >= 4)
    {
        if(sscanf(params, "ui", pID, value)) return SendClientMessage(playerid, -1, "Usage: /setvip (id) (level)");
        else if(value < 0 || value > 3) return SendClientMessage(playerid, -1, "Only levels 0-3");
        else if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Player Is Not Currently Connected");
        else
        {
            new string[128], string1[128], target[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME];
            GetPlayerName(playerid, pName, sizeof(pName));
            GetPlayerName(pID, target, sizeof(target));
            format(string, sizeof(string), "You have set %s Vip Level to %i", target, value);
            SendClientMessage(playerid, -1, string);
            format(string1, sizeof(string1), "Your VIP level has been set to %i by %s", value, pName); // You used 'string' instead of 'string1'.
            SendClientMessage(pID, -1, string1);
            PlayerInfo[pID][pVIPlevel] = value;
        }
    }
    return 1;
}
Reply
#3

Oh thanks.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)