Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:agl(playerid,params[])
- {
- if(gPlayerLogged[playerid] == 0) return SCM(playerid, COLOR_LIGHTRED, "Nu esti logat.");
- if(IsPlayerConnected(playerid))
- {
- if (PlayerInfo[playerid][pAdmin] >= 2)
- {
- new id,x_nr[10],sendername[25],giveplayer[25],string[128];
- if(sscanf(params, "us[10]",id,x_nr))
- {
- SendClientMessage(playerid, COLOR_WHITE, "{25FDE9}Usage: {25FDE9}/agl <Name/Playerid> <License>");
- SendClientMessage(playerid, COLOR_WHITE, "Available names: Driving, Pilots, Sailing, Weapon, All.");
- return 1;
- }
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: Player not connected.");
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(id, giveplayer, sizeof(giveplayer));
- if(strcmp(x_nr,"driving",true) == 0)
- {
- format(string, sizeof(string), "* You've given a Drivers License to %s.",giveplayer);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "* Admin %s has given you a Drivers License.",sendername);
- SendClientMessage(id, COLOR_LIGHTBLUE, string);
- PlayerInfo[id][pCarLic] = 1;
- PlayerInfo[id][pCarLicT] = 100;
- PlayerInfo[id][pCarLicSuspend] = 0;
- Update(id, pCarLicSuspendx);
- new str[128];
- mysql_format(SQL,str,128,"UPDATE users SET `CarLic`='1',`CarLicT`='100' WHERE `name`='%s'",PlayerInfo[id][pNormalName]);
- mysql_tquery(SQL,str,"","");
- return 1;
- }
- else if(strcmp(x_nr,"pilots",true) == 0)
- {
- format(string, sizeof(string), "* You've given a Pilots License to %s.",giveplayer);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "* Admin %s has given you a Pilots License.",sendername);
- SendClientMessage(id, COLOR_LIGHTBLUE, string);
- PlayerInfo[id][pFlyLic] = 1;
- PlayerInfo[id][pFlyLicT] = 100;
- new str[128];
- mysql_format(SQL,str,128,"UPDATE users SET `FlyLic`='1',`FlyLicT`='100' WHERE `name`='%s'",PlayerInfo[id][pNormalName]);
- mysql_tquery(SQL,str,"","");
- return 1;
- }
- else if(strcmp(x_nr,"sailing",true) == 0)
- {
- format(string, sizeof(string), "* You've given a Sailing License to %s.",giveplayer);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "* Admin %s has given you a Sailing License.",sendername);
- SendClientMessage(id, COLOR_LIGHTBLUE, string);
- PlayerInfo[id][pBoatLic] = 1;
- PlayerInfo[id][pBoatLicT] = 100;
- new str[128];
- mysql_format(SQL,str,128,"UPDATE users SET `BoatLic`='1',`BoatLicT`='100' WHERE `name`='%s'",PlayerInfo[id][pNormalName]);
- mysql_tquery(SQL,str,"","");
- return 1;
- }
- else if(strcmp(x_nr,"weapon",true) == 0)
- {
- format(string, sizeof(string), "* You've given a Weapon License to %s.",giveplayer);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "* Admin %s has given you a Weapon License.",sendername);
- SendClientMessage(id, COLOR_LIGHTBLUE, string);
- PlayerInfo[id][pGunLic] = 1;
- PlayerInfo[id][pGunLicT] = 100;
- PlayerInfo[id][pGunLicSuspend] = 0;
- Update(id, pGunLicSuspendx);
- new str[128];
- mysql_format(SQL,str,128,"UPDATE users SET `GunLic`='1',`GunLicT`='100' WHERE `name`='%s'",PlayerInfo[id][pNormalName]);
- mysql_tquery(SQL,str,"","");
- return 1;
- }
- else if(strcmp(x_nr,"all",true) == 0)
- {
- format(string, sizeof(string), "* You've given All Licenses to %s.",giveplayer);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "* Admin %s has given you All Licenses.",sendername);
- SendClientMessage(id, COLOR_LIGHTBLUE, string);
- //gun
- PlayerInfo[id][pGunLic] = 1;
- PlayerInfo[id][pGunLicT] = 100;
- PlayerInfo[id][pGunLicSuspend] = 0;
- Update(id, pGunLicSuspendx);
- new str[128];
- mysql_format(SQL,str,128,"UPDATE users SET `GunLic`='1',`GunLicT`='100' WHERE `name`='%s'",PlayerInfo[id][pNormalName]);
- mysql_tquery(SQL,str,"","");
- //boat
- PlayerInfo[id][pBoatLic] = 1;
- PlayerInfo[id][pBoatLicT] = 100;
- new str[128];
- mysql_format(SQL,str,128,"UPDATE users SET `BoatLic`='1',`BoatLicT`='100' WHERE `name`='%s'",PlayerInfo[id][pNormalName]);
- mysql_tquery(SQL,str,"","");
- //pilot
- PlayerInfo[id][pFlyLic] = 1;
- PlayerInfo[id][pFlyLicT] = 100;
- new str[128];
- mysql_format(SQL,str,128,"UPDATE users SET `FlyLic`='1',`FlyLicT`='100' WHERE `name`='%s'",PlayerInfo[id][pNormalName]);
- mysql_tquery(SQL,str,"","");
- //driving
- PlayerInfo[id][pCarLic] = 1;
- PlayerInfo[id][pCarLicT] = 100;
- PlayerInfo[id][pCarLicSuspend] = 0;
- Update(id, pCarLicSuspendx);
- mysql_format(SQL,str,128,"UPDATE users SET `CarLic`='1',`CarLicT`='100' WHERE `name`='%s'",PlayerInfo[id][pNormalName]);
- mysql_tquery(SQL,str,"","");
- new str[128];
- mysql_format(SQL,str,128,"UPDATE users SET `GunLic`='1',`GunLicT`='100',`BoatLic`='1',`BoatLicT`='100',`FlyLic`='1',`FlyLicT`='100',`CarLic`='1',`CarLicT`='100' WHERE `name`='%s'",PlayerInfo[id][pNormalName]);
- mysql_tquery(SQL,str,"","");
- return 1;
- }
- }
- else return SendClientMessage(playerid, COLOR_ERROR, AdminOnly);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement