Licenses help
#1

pawn Код:
CMD:licenses(playerid, params[])
{
    new string[256], carlicense[128], flylicense[128], weplicense[128];
    if(PlayerInfo[playerid][pCarLic] == 1) format(carlicense, sizeof(carlicense), "Passed");
    else if(PlayerInfo[playerid][pCarLic] == 0) format(carlicense, sizeof(carlicense), "Not Passed");
    if(PlayerInfo[playerid][pFlyLic] == 1) format(flylicense, sizeof(flylicense), "Passed");
    else if(PlayerInfo[playerid][pFlyLic] == 0) format(flylicense, sizeof(flylicense), "Not Passed");
    if(PlayerInfo[playerid][pWepLic] == 1) format(weplicense, sizeof(weplicense), "Passed");
    else if(PlayerInfo[playerid][pWepLic] == 0) format(weplicense, sizeof(weplicense), "Not Passed");
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    format(string, sizeof(string), "|____ %s Licenses ____|", RPN(playerid));
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "Name: {FFFFFF}%s", RPN(playerid));
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "Driving License Status: {FFFFFF}%s", carlicense);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "Flying License Status: {FFFFFF}%s", flylicense);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "Weapon License Status: {FFFFFF}%s", weplicense);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    return 1;
}

CMD:showlicenses(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]: /showlicenses [playerid]");
    if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
    new string[43];
    format(string, sizeof(string), "|____ %s Licenses ____|", RPN(playerb));
    SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "Name: {FFFFFF}%s", RPN(playerb));
    SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "Driving License Status: {FFFFFF}%s", (PlayerInfo[playerb][pCarLic]) ? ("Passed") : ("Not Passed"));
    SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "Flying License Status: {FFFFFF}%s", (PlayerInfo[playerb][pFlyLic]) ? ("Passed") : ("Not Passed"));
    SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "Weapon License Status: {FFFFFF}%s", (PlayerInfo[playerb][pWepLic]) ? ("Passed") : ("Not Passed"));
    SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
    return 1;
}

CMD:getlicense(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!IsPlayerInRangeOfPoint(playerid,2.0,962.3975,-1433.5745,14.0537)) return SendClientMessage(playerid, COLOR_GREY, "You are not by the DMV desk.");
    SSSShowDialog(playerid, 39);
    return 1;
}
Well if you do /showlicenses to the person you see your own licenses, or if you do /showlicenses to the person, he see his own licenses, so, how can i fix that
Reply
#2

Why don't you just change /licenses to /showlicenses and /showlicenses to /licenses ?xd

I can't see where the problem is actually when I read the code...
Reply
#3

I will upload a video
Reply
#4

pawn Код:
format(string, sizeof(string), "|____ %s Licenses ____|", RPN(playerid));
    SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "Name: {FFFFFF}%s", RPN(playerid));
    SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "Driving License Status: {FFFFFF}%s", (PlayerInfo[playerid][pCarLic]) ? ("Passed") : ("Not Passed"));
    SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "Flying License Status: {FFFFFF}%s", (PlayerInfo[playerid][pFlyLic]) ? ("Passed") : ("Not Passed"));
    SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "Weapon License Status: {FFFFFF}%s", (PlayerInfo[playerid][pWepLic]) ? ("Passed") : ("Not Passed"));
    SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
Reply
#5

Make an giveplayerid variable

for example

SendClientMessage(giveplayerid, COLOR_WHITE, string);

It means it will send the message to the person that you give
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)