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 == 1) return SendClientMessage(playerid, COLOR_RED, "You already have a driving license.");
if(HasDrivingLic == 0)
(HasDrivingLic = 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 == 1) return SendClientMessage(playerid, COLOR_RED, "You already have a gun license.");
if(HasGunLic == 0)
(HasGunLic = 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 == 1) return SendClientMessage(playerid, COLOR_RED, "You already have a pilot license.");
if(HasFlyingLic == 0)
(HasFlyingLic = 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, drivinglic, gunlic,flyinglic;
if(HasDrivingLic == 0) drivinglic = "Not Passed";
else drivinglic = "Passed";
if(HasGunLic == 0) gunlic = "Not Passed";
else gunlic = "Passed";
if(HasFlyingLic == 0) flyinglic = "Not Passed";
else flyinglic = "Passed";
format(lic, sizeof(lic), "** Your Licenses - : %s || : %s || : %s", drivinglic,gunlic,flyinglic);
SendClientMessage(playerid, -1, lic);
return 1;
}
CMD:checklic(playerid, params[])
{
new lic1, drivinglic, gunlic,flyinglic;
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 ");
if(!IsPlayerNearPlayer(playerid, playerb, 5.0)) return SendClientMessage(playerid, COLOR_RED, "You are too far away from that player.");
if(HasDrivingLic == 0) drivinglic = "Not Passed";
else drivinglic = "Passed";
if(HasGunLic == 0) gunlic = "Not Passed";
else gunlic = "Passed";
if(HasFlyingLic == 0) flyinglic = "Not Passed";
else flyinglic = "Passed";
format(lic1, sizeof(lic1), "** %s's Licenses - : %s || : %s || : %s",NAMEGET(playerid),drivinglic,gunlic,flyinglic);
SendClientMessage(playerid, -1, lic1);
return 1;
}
CMD:showlic(playerid, params[])
{
new lic2, drivinglic, gunlic,flyinglic;
new playerb;
if(sscanf(params,"u",playerb)) return SendClientMessage(playerid,-1,"Usage: /showlic ");
if(!IsPlayerNearPlayer(playerid, playerb, 5.0)) return SendClientMessage(playerid, COLOR_RED, "You are too far away from that player.");
if(HasDrivingLic == 0) drivinglic = "Not Passed";
else drivinglic = "Passed";
if(HasGunLic == 0) gunlic = "Not Passed";
else gunlic = "Passed";
if(HasFlyingLic == 0) flyinglic = "Not Passed";
else flyinglic = "Passed";
format(lic2, sizeof(lic2), "** %s's Licenses - : %s || : %s || : %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;
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 ");
if(!IsPlayerNearPlayer(playerid, playerb, 5.0)) return SendClientMessage(playerid, COLOR_RED, "You are too far away from that player.");
if(HasDrivingLic == 0) return SendClientMessage(playerid, COLOR_RED, "This person doesnt have driving license to suspend.");
if(HasDrivingLic == 1)
(HasDrivingLic = 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;
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 ");
if(!IsPlayerNearPlayer(playerid, playerb, 5.0)) return SendClientMessage(playerid, COLOR_RED, "You are too far away from that player.");
if(HasGunLic == 0) return SendClientMessage(playerid, COLOR_RED, "This person doesnt have gun license to suspend.");
if(HasGunLic == 1)
(HasGunLic = 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;
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 ");
if(!IsPlayerNearPlayer(playerid, playerb, 5.0)) return SendClientMessage(playerid, COLOR_RED, "You are too far away from that player.");
if(HasFlyingLic == 0) return SendClientMessage(playerid, COLOR_RED, "This person doesnt have flying license to suspend.");
if(HasFlyingLic == 1)
(HasFlyingLic = 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;
}