Command problem
#1

This command works only on id 0, the problem is with "playerb"
Can anyone fix it?
pawn Код:
CMD:stealclothes(playerid, params[])
{
    new playerb, string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /stealclothes [playerid]");
    if(!IsALeone(playerid) && !IsACorleone(playerid) && !IsALaVice(playerid) && !IsAESF(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not a member of any criminal faction.");
    if(IsPlayerNearPlayer(playerid, playerb, 2)) return SendClientMessage(playerid, COLOR_GREY, "You are not close enough at the player");
    if(!IsPlayerKnocked(playerb))return SendClientMessage(playerid, COLOR_GREY, "The player isn't knocked");
    {
        SetPlayerSkin(playerid, PlayerInfo[playerb][pModel]);
        SetPlayerSkin(playerb, 252);
        format(string, sizeof(string), "* %s has stole the clothes from %s.", RPN(playerid), RPN(playerb));
        SendNearbyMessage(playerid, 15, string, COLOR_LIGHTBLUE, COLOR_LIGHTBLUE, COLOR_LIGHTBLUE, COLOR_LIGHTBLUE, COLOR_LIGHTBLUE);
        }
    return 1;
}
Reply
#2

What does it say/do ?
pawn Код:
CMD:stealclothes(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");

    new playerb;
    if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /stealclothes [playerid]");

    if(!IsALeone(playerid) && !IsACorleone(playerid) && !IsALaVice(playerid) && !IsAESF(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not a member of any criminal faction.");
    if(IsPlayerNearPlayer(playerid, playerb, 2)) return SendClientMessage(playerid, COLOR_GREY, "You are not close enough at the player");
    if(!IsPlayerKnocked(playerb)) return SendClientMessage(playerid, COLOR_GREY, "The player isn't knocked");

    string[128];
    format(string, sizeof(string), "%s's new skin: %d", RPN(playerid), PlayerInfo[playerb][pModel]);
    SendClientMessageToAll(-1, string);
    SetPlayerSkin(playerid, PlayerInfo[playerb][pModel]);
    SetPlayerSkin(playerb, 252);
   
    format(string, sizeof(string), "* %s has stole the clothes from %s.", RPN(playerid), RPN(playerb));
    SendNearbyMessage(playerid, 128, string, COLOR_LIGHTBLUE, COLOR_LIGHTBLUE, COLOR_LIGHTBLUE, COLOR_LIGHTBLUE, COLOR_LIGHTBLUE);

    return 1;
}
added a simple debug,
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)