02.02.2013, 18:45
Hello..
I want the guns you have before going on aduty to save and that you get them back when you go off aduty, How can i make this? I have tried with the /aduty cmd but it dosnt work for me, no errors when i complie but i still dont get back my guns when i go off aduty so im hoping that someone here could help me!
Here is the /aduty command
I want the guns you have before going on aduty to save and that you get them back when you go off aduty, How can i make this? I have tried with the /aduty cmd but it dosnt work for me, no errors when i complie but i still dont get back my guns when i go off aduty so im hoping that someone here could help me!
Here is the /aduty command
pawn Код:
if(!strcmp(cmdtext, "/adminduty", true) || !strcmp(cmdtext, "/aduty", true))
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You need to login first !");
return 1;
}
if(PlayerInfo[playerid][pAdmin] >= 1)
{
if(PlayerInfo[playerid][pAdminDuty] == 0)
{
PlayerInfo[playerid][pAdminDuty] = 1;
SetPlayerColor(playerid,0xFD0000FF);
format(string, sizeof(string),"[ADMIN]: %s is now on Admin Duty", sendername);
ABroadCast(COLOR_LIGHTRED, string, 1);
DutyLabel[playerid] = Create3DTextLabel("Admin On Duty \n Do NOT Attack",0xFF000099,0,0,0,50,-1,1);
Attach3DTextLabelToPlayer(DutyLabel[playerid], playerid, 0,0,0);
if(PlayerInfo[playerid][pAdmin] >= 5)
{
for(new i = 0; i < sizeof(CarInfo); i++)
{
SetVehicleParamsForPlayer(i,playerid,0,0);
}
}
if(PlayerInfo[playerid][pAdmin] >= 3)
{
SetPlayerColor(playerid,0xFD0000FF); // Senior Admin Colour (Dark Red)
SetPlayerSkin(playerid, 294);
new Float:AX,Float:AY,Float:AZ;
GetPlayerPos(playerid, AX,AY,AZ);
SafeSetPlayerPos(playerid, AX,AY,AZ+1);
UpdatePlayerPosition(playerid);
SetPlayerHealth(playerid, 99999);
SetPlayerArmour(playerid, 99999);
}
if(PlayerInfo[playerid][pAdmin] >= 6)
{
SaveGuns(playerid);
SafeResetPlayerWeapons(playerid);
SafeGivePlayerWeapon(playerid, 42, 10000);
SafeGivePlayerWeapon(playerid, 39, 10000);
SafeGivePlayerWeapon(playerid, 38, 10000);
SafeGivePlayerWeapon(playerid, 34, 10000);
SafeGivePlayerWeapon(playerid, 31, 10000);
SafeGivePlayerWeapon(playerid, 29, 10000);
SafeGivePlayerWeapon(playerid, 27, 10000);
SafeGivePlayerWeapon(playerid, 24, 10000);
SafeGivePlayerWeapon(playerid, 40, 1);
SafeGivePlayerWeapon(playerid, 10, 1);
SafeGivePlayerWeapon(playerid, 9, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1000);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, 1000);
SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, 1000);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, 1000);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1000);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, 1000);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 1000);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, 1000);
SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 1000);
SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 1000);
}
return 1;
}
else if(PlayerInfo[playerid][pAdminDuty] == 1)
{
if(PlayerInfo[playerid][pAdmin] >= 6)
{
if(Spectate[playerid] == 255)
{
SafeResetPlayerWeapons(playerid);
SetPlayerWeapons(playerid);
}
SetPlayerSkills(playerid);
SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
SetPlayerArmour(playerid, PlayerInfo[playerid][pArmour]);
}
Delete3DTextLabel(DutyLabel[playerid]);
PlayerInfo[playerid][pAdminDuty] = 0;
new originalskin = PlayerInfo[playerid][pChar];
SetPlayerSkin(playerid, originalskin);
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
SafeSetPlayerPos(playerid, X,Y,Z+1);
SetPlayerToTeamColor(playerid);
format(string, sizeof(string),"[ADMIN]: %s is now off Admin Duty", sendername);
ABroadCast(COLOR_LIGHTRED, string, 1);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /adminduty",d,m,y,h,mi,s,sendername);
AdminLog(string);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "** You're not an admin !");
return 1;
}
}
return 1;
}