Question.
#1

Hey, i just made a new command to show my ID card to someone else. But when i use the command it just shows it to myself instead of showing it to someone else.

pawn Код:
CMD:showid(playerid, params[])
{
    new giveplayerid;
    new string[128];
    if(sscanf(params, "u", giveplayerid))
    {
        SendClientMessageEx(playerid, COLOR_WHITE, "[Server]: {FFFFFF}/showasl (playerid)");
        return 1;
    }
    if(IsPlayerConnected(giveplayerid))
    {
        if (ProxDetectorS(8.0, playerid, giveplayerid))
        {
            format(string, sizeof(string), "> %s has given their identifcation details to %s.", GetPlayerNameEx(playerid),GetPlayerNameEx(giveplayerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            ShowASL(playerid,giveplayerid);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "> This player isn't near you.");
        }

    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GREY, "> Invalid player specified.");
        return 1;
    }
    return 1;
}
Do i have to change this to something else to make it work?

pawn Код:
ShowASL(playerid,giveplayerid);
Reply
#2

Can you show us your public?
Reply
#3

pawn Код:
ShowASL(playerid, targetid)
{
    if (IsPlayerConnected(targetid))
    {
        new sext[16], nat[30];
        new age = PlayerInfo[targetid][pAge];
        new crimes = PlayerInfo[targetid][pCrimes];
        new arrests = PlayerInfo[targetid][pArrested];
        switch(PlayerInfo[targetid][pAccent])
        {
                case 1: nat = "Unknown";
                case 2: nat = "British";
                case 3: nat = "Japanese";
                case 4: nat = "Chinese";
                case 5: nat = "Korean";
                case 6: nat = "Scottish";
                case 7: nat = "Irish";
                case 8: nat = "Russian";
                case 9: nat = "American";
                case 10: nat = "Mexican";
                case 11: nat = "Texan";
                case 12: nat = "Cuban";
                case 13: nat = "Italian";
                case 14: nat = "Gangsta";
                case 15: nat = "Australia";
                case 16: nat = "Arabic";
                case 17: nat = "Balkan";
                case 18: nat = "Canadian";
                case 19: nat = "Jamaican";
                case 20: nat = "Israeli";
                default: nat = "Unknown";
        }
        if(PlayerInfo[targetid][pSex] == 1) { sext = "Male"; } else { sext = "Female"; }
        new string[128];
        format(string, sizeof(string),"Name: {FFFFFF}%s | {AFAFAF}Age: {FFFFFF}%d | {AFAFAF}Gender: {FFFFFF}%s | {AFAFAF}Nationality: {FFFFFF}%s.", GetPlayerNameEx(targetid), age, sext, nat);
        SendClientMessageEx(playerid, COLOR_GREY,string);
        if(gTeam[playerid] == 2 || IsACop(playerid) || (PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pDivision] == 2) || (PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pRank] >= 5) || (PlayerInfo[playerid][pMember] == 12 && PlayerInfo[playerid][pDivision] == 2) || (PlayerInfo[playerid][pMember] == 9 && PlayerInfo[playerid][pDivision] == 1))
        {
            SendClientMessage(playerid, COLOR_GREY, "> Additional LEO Information.");
            format(string, sizeof(string),"Crimes commited: {FFFFFF}%d", crimes);
            SendClientMessageEx(playerid, COLOR_GREY,string);
            format(string, sizeof(string),"Times arrested: {FFFFFF}%d", arrests);
            SendClientMessageEx(playerid, COLOR_GREY,string);
        }
    }
}
Reply
#4

Small bump.
Reply
#5

Change
pawn Код:
SendClientMessageEx(playerid, COLOR_GREY,string);
to
pawn Код:
SendClientMessageEx(targetid, COLOR_GREY,string);
at your public
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)