[Pomoc] Oko Komande

Započeo Schwarz, Decembar 14, 2012, 22:04:19 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: Moja iz 0
Detaljan opis problema: imam ove comande i sta mi sad kao varijabla treba kako da uradim da zacuvuje kad neki igrac kupi licencu i kako na disconnect da zacuvuje kad kupi licence
Dio skripte://
Neke slike/video za lakse dobivanje pomoci(neobavezno)://

Evo komande:
CMD:buydrivinglic(playerid, params[])
{
if(!IsPlayerInRangeOfPoint(playerid, 5.0, 2046.6372,-1908.0178,13.5469)) return SendClientMessage(playerid,-1,"You must be near the DMV to obtain a driving license.");
if(HasDrivingLic[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You already have a driving license.");
if(HasDrivingLic[playerid] == 0)
(HasDrivingLic[playerid] = 1);
GivePlayerMoney(playerid, -2000);
SendClientMessage(playerid, -1, "You've bought a driving license for $2000, drive safely, otherwise the police department may suspend it from you.");
return 1;
}

CMD:buygunlic(playerid, params[])
{
        if(!IsPlayerInRangeOfPoint(playerid, 5.0, 2046.6372,-1908.0178,13.5469)) return SendClientMessage(playerid,-1,"You must be near the DMV to obtain a gun license.");
        if(HasGunLic[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You already have a gun license.");
        if(HasGunLic[playerid] == 0)
        (HasGunLic[playerid] = 1);
        GivePlayerMoney(playerid, -2000);
        SendClientMessage(playerid, -1, "You've bought a gun license for $2000, remember - you are only allowed to carry light weaponry infront of your house.");
        return 1;
}

CMD:buyflyinglic(playerid, params[])
{
        if(!IsPlayerInRangeOfPoint(playerid, 5.0, 2046.6372,-1908.0178,13.5469)) return SendClientMessage(playerid,-1,"You must be near the DMV to obtain a flying license.");
        if(HasFlyingLic[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You already have a pilot license.");
        if(HasFlyingLic[playerid] == 0)
        (HasFlyingLic[playerid] = 1);
        GivePlayerMoney(playerid, -2000);
        SendClientMessage(playerid, -1, "You've bought a pilot license for $2000, you are now able to fly with any helicopter/plane.");
        return 1;
}


CMD:mylic(playerid, params[])
{
        new lic[128], drivinglic[12], gunlic[12],flyinglic[12];
        if(HasDrivingLic[playerid] == 0) drivinglic = "Not Passed";
        else drivinglic = "Passed";
        if(HasGunLic[playerid] == 0) gunlic = "Not Passed";
        else gunlic = "Passed";
        if(HasFlyingLic[playerid] == 0)  flyinglic = "Not Passed";
        else flyinglic = "Passed";
        format(lic, sizeof(lic), "** Your Licenses - [Driving]: %s || [Gun]: %s || [Flying]: %s", drivinglic,gunlic,flyinglic);
        SendClientMessage(playerid, -1, lic);
        return 1;
}


CMD:checklic(playerid, params[])
{
        new lic1[128], drivinglic[12], gunlic[12],flyinglic[12];
        new playerb;
        new pSkin;
        pSkin = GetPlayerSkin(playerid);
        if(pSkin == 265||pSkin == 266||pSkin == 267||pSkin == 280||pSkin == 282||pSkin == 288||pSkin == 165||pSkin == 166||pSkin == 284||pSkin == 285||pSkin == 286||pSkin == 287||pSkin == 283)
        if(sscanf(params,"u",playerb)) return SendClientMessage(playerid,-1,"Usage: /checklic [id]");
        if(!IsPlayerNearPlayer(playerid, playerb, 5.0)) return SendClientMessage(playerid, COLOR_RED, "You are too far away from that player.");
        if(HasDrivingLic[playerb] == 0) drivinglic = "Not Passed";
        else drivinglic = "Passed";
        if(HasGunLic[playerb] == 0) gunlic = "Not Passed";
        else gunlic = "Passed";
        if(HasFlyingLic[playerb] == 0)  flyinglic = "Not Passed";
        else flyinglic = "Passed";
        format(lic1, sizeof(lic1), "** %s's Licenses - [Driving]: %s || [Gun]: %s || [Flying]: %s",NAMEGET(playerid),drivinglic,gunlic,flyinglic);
        SendClientMessage(playerid, -1, lic1);
        return 1;
}

CMD:showlic(playerid, params[])
{
        new lic2[128], drivinglic[12], gunlic[12],flyinglic[12];
        new playerb;
        if(sscanf(params,"u",playerb)) return SendClientMessage(playerid,-1,"Usage: /showlic [id]");
        if(!IsPlayerNearPlayer(playerid, playerb, 5.0)) return SendClientMessage(playerid, COLOR_RED, "You are too far away from that player.");
        if(HasDrivingLic[playerid] == 0) drivinglic = "Not Passed";
        else drivinglic = "Passed";
        if(HasGunLic[playerid] == 0) gunlic = "Not Passed";
        else gunlic = "Passed";
        if(HasFlyingLic[playerid] == 0)  flyinglic = "Not Passed";
        else flyinglic = "Passed";
        format(lic2, sizeof(lic2), "** %s's Licenses - [Driving]: %s || [Gun]: %s || [Flying]: %s",NAMEGET(playerid),drivinglic,gunlic,flyinglic);
        SendClientMessage(playerb, -1, lic2);
        format(lic2, sizeof(lic2), "*** %s takes out his/her licenses and shows them to %s.", NAMEGET(playerid), NAMEGET(playerb));
        if(playerb == playerid)
        format(lic2, sizeof(lic2), "*** %s takes out his/her licenses and takes a look at them.", NAMEGET(playerid));
        NearMessageSender(playerid, 5.0, lic2, COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1);
        return 1;
}

CMD:sdrivinglic(playerid, params[])
{
        new lic3[128];
        new playerb;
        new pSkin;
        pSkin = GetPlayerSkin(playerid);
        if(pSkin == 265||pSkin == 266||pSkin == 267||pSkin == 280||pSkin == 282||pSkin == 288||pSkin == 165||pSkin == 166||pSkin == 284||pSkin == 285||pSkin == 286||pSkin == 287||pSkin == 283)
        if(sscanf(params,"u",playerb)) return SendClientMessage(playerid,-1,"Usage: /sdrivinglic [id]");
        if(!IsPlayerNearPlayer(playerid, playerb, 5.0)) return SendClientMessage(playerid, COLOR_RED, "You are too far away from that player.");
        if(HasDrivingLic[playerb] == 0) return SendClientMessage(playerid, COLOR_RED, "This person doesnt have driving license to suspend.");
    if(HasDrivingLic[playerb] == 1)
    (HasDrivingLic[playerb] = 0);
    format(lic3, sizeof(lic3), "** Law Enforcer %s has suspended your driving license, beware cause the police may ticket you.", NAMEGET(playerid));
    SendClientMessage(playerb, COLOR_RED, lic3);
    format(lic3, sizeof(lic3), "** You have suspended %s's driving license.", NAMEGET(playerb));
    SendClientMessage(playerid, COLOR_RED, lic3);
        return 1;
}

CMD:sgunlic(playerid, params[])
{
        new lic4[128];
        new playerb;
        new pSkin;
        pSkin = GetPlayerSkin(playerid);
        if(pSkin == 265||pSkin == 266||pSkin == 267||pSkin == 280||pSkin == 282||pSkin == 288||pSkin == 165||pSkin == 166||pSkin == 284||pSkin == 285||pSkin == 286||pSkin == 287||pSkin == 283)
        if(sscanf(params,"u",playerb)) return SendClientMessage(playerid,-1,"Usage: /sgunlic [id]");
        if(!IsPlayerNearPlayer(playerid, playerb, 5.0)) return SendClientMessage(playerid, COLOR_RED, "You are too far away from that player.");
        if(HasGunLic[playerb] == 0) return SendClientMessage(playerid, COLOR_RED, "This person doesnt have gun license to suspend.");
    if(HasGunLic[playerb] == 1)
    (HasGunLic[playerb] = 0);
    format(lic4, sizeof(lic4), "** Law Enforcer %s has suspended your gun license, you cannot use any legal weaponry now.", NAMEGET(playerid));
    SendClientMessage(playerb, COLOR_RED, lic4);
    format(lic4, sizeof(lic4), "** You have suspended %s's gun license.", NAMEGET(playerb));
    SendClientMessage(playerid, COLOR_RED, lic4);
        return 1;
}

CMD:sflyinglic(playerid, params[])
{
        new lic5[128];
        new playerb;
        new pSkin;
        pSkin = GetPlayerSkin(playerid);
        if(pSkin == 265||pSkin == 266||pSkin == 267||pSkin == 280||pSkin == 282||pSkin == 288||pSkin == 165||pSkin == 166||pSkin == 284||pSkin == 285||pSkin == 286||pSkin == 287||pSkin == 283)
        if(sscanf(params,"u",playerb)) return SendClientMessage(playerid,-1,"Usage: /sflyinglic [id]");
        if(!IsPlayerNearPlayer(playerid, playerb, 5.0)) return SendClientMessage(playerid, COLOR_RED, "You are too far away from that player.");
        if(HasFlyingLic[playerb] == 0) return SendClientMessage(playerid, COLOR_RED, "This person doesnt have flying license to suspend.");
    if(HasFlyingLic[playerb] == 1)
    (HasFlyingLic[playerb] = 0);
    format(lic5, sizeof(lic5), "** Law Enforcer %s has suspended your flying license, you may not fly with any helicopter/plane.", NAMEGET(playerid));
    SendClientMessage(playerb, COLOR_RED, lic5);
    format(lic5, sizeof(lic5), "** You have suspended %s's flying license.", NAMEGET(playerb));
    SendClientMessage(playerid, COLOR_RED, lic5);
        return 1;
}

kao sto si napravio cuvanje za ostale varijable tako napravi i za ovu, ako znas rukovati sa sistemom spremanja koji koristis, lako je xd