SA-MP Forums Archive
Licenses help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Licenses help (/showthread.php?tid=504084)



Licenses help - lulo356 - 01.04.2014

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


Re: Licenses help - Gus_Stone - 01.04.2014

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...


Re: Licenses help - lulo356 - 01.04.2014

I will upload a video


Re: Licenses help - TonyII - 02.04.2014

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);



Re: Licenses help - ChristianIvann09 - 02.04.2014

Make an giveplayerid variable

for example

SendClientMessage(giveplayerid, COLOR_WHITE, string);

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