Код:
line number 37947
CMD:removebackpack(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
new giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /removebackpack [playerid]");
if(IsPlayerConnected(giveplayerid))
{
if(PBInfo[playerid][IsWearing] == true) TogglePlayerBackpack(playerid, false);
new forrr[128];
PBInfo[giveplayerid][HasBackpack] = 0;
PBInfo[giveplayerid][Type] = 0;
format(forrr, sizeof(forrr), "AdmCmd: %s has removed %s's backpack!", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
SendClientMessageToAllEx(COLOR_LIGHTRED, forrr);
PBInfo[playerid][Weed] = 0;
PBInfo[playerid][Crack] = 0;
PBInfo[playerid][IsWearing] = false;
PBInfo[playerid][Materials] = 0;
PBInfo[playerid][Gun1] = 0;
PBInfo[playerid][Gun2] = 0;
PBInfo[playerid][Gun3] = 0;
PBInfo[playerid][Gun4] = 0;
PBInfo[playerid][Gun5] = 0;
PBInfo[playerid][Gun6] = 0;
PBInfo[playerid][Gun7] = 0;
PBInfo[playerid][Gun8] = 0;
}
else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
}
else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
return 1;
}
line number 37988,38002,38011,38025,38048
MD:givebackpack(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
new giveplayerid, type;
if(sscanf(params, "ud", giveplayerid, type)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /givebackpack [playerid] [type(0 small, 1 medium, 2 large)");
if(IsPlayerConnected(giveplayerid))
{
new forrr[128];
if(type == 0)
{
PBInfo[giveplayerid][HasBackpack] = 1;
format(forrr, sizeof(forrr), "AdmCmd: %s has given %s a small backpack!", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
PBInfo[giveplayerid][Type] = 0;
SendClientMessageToAllEx(COLOR_LIGHTRED, forrr);
if(PBInfo[giveplayerid][IsWearing] == true) TogglePlayerBackpack(giveplayerid, false);
PBInfo[giveplayerid][Weed] = 0;
PBInfo[giveplayerid][Crack] = 0;
PBInfo[giveplayerid][IsWearing] = false;
PBInfo[giveplayerid][Materials] = 0;
PBInfo[giveplayerid][Gun1] = 0;
PBInfo[giveplayerid][Gun2] = 0;
PBInfo[giveplayerid][Gun3] = 0;
PBInfo[giveplayerid][Gun4] = 0;
PBInfo[giveplayerid][Gun5] = 0;
PBInfo[giveplayerid][Gun6] = 0;
PBInfo[giveplayerid][Gun7] = 0;
PBInfo[giveplayerid][Gun8] = 0;
PBInfo[giveplayerid][IsWearing] = true;
TogglePlayerBackpack(giveplayerid, true);
SendClientMessage(giveplayerid, -1, "{FFD700}You are now wearing a small backpack");
}
else if(type == 1)
{
PBInfo[giveplayerid][HasBackpack] = 1;
format(forrr, sizeof(forrr), "AdmCmd: %s has given %s a medium backpack!", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
PBInfo[giveplayerid][Type] = 1;
SendClientMessageToAllEx(COLOR_LIGHTRED, forrr);
if(PBInfo[giveplayerid][IsWearing] == true) TogglePlayerBackpack(giveplayerid, false);
PBInfo[giveplayerid][Weed] = 0;
PBInfo[giveplayerid][Crack] = 0;
PBInfo[giveplayerid][IsWearing] = false;
PBInfo[giveplayerid][Materials] = 0;
PBInfo[giveplayerid][Gun1] = 0;
PBInfo[giveplayerid][Gun2] = 0;
PBInfo[giveplayerid][Gun3] = 0;
PBInfo[giveplayerid][Gun4] = 0;
PBInfo[giveplayerid][Gun5] = 0;
PBInfo[giveplayerid][Gun6] = 0;
PBInfo[giveplayerid][Gun7] = 0;
PBInfo[giveplayerid][Gun8] = 0;
PBInfo[giveplayerid][IsWearing] = true;
TogglePlayerBackpack(giveplayerid, true);
SendClientMessage(giveplayerid, -1, "{FFD700}You are now wearing a medium backpack");
}
else if(type == 2)
{
PBInfo[giveplayerid][HasBackpack] = 1;
format(forrr, sizeof(forrr), "AdmCmd: %s has given %s a large backpack!", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
PBInfo[giveplayerid][Type] = 2;
SendClientMessageToAllEx(COLOR_LIGHTRED, forrr);
if(PBInfo[giveplayerid][IsWearing] == true) TogglePlayerBackpack(giveplayerid, false);
PBInfo[giveplayerid][Weed] = 0;
PBInfo[giveplayerid][Crack] = 0;
PBInfo[giveplayerid][IsWearing] = false;
PBInfo[giveplayerid][Materials] = 0;
PBInfo[giveplayerid][Gun1] = 0;
PBInfo[giveplayerid][Gun2] = 0;
PBInfo[giveplayerid][Gun3] = 0;
PBInfo[giveplayerid][Gun4] = 0;
PBInfo[giveplayerid][Gun5] = 0;
PBInfo[giveplayerid][Gun6] = 0;
PBInfo[giveplayerid][Gun7] = 0;
PBInfo[giveplayerid][Gun8] = 0;
PBInfo[giveplayerid][IsWearing] = true;
TogglePlayerBackpack(giveplayerid, true);
SendClientMessage(giveplayerid, -1, "{FFD700}You are now wearing a large backpack");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "Types are 0 for small, 1 for medium and 2 for large!");
}
return 1;
}
else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
}
else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
return 1;
}
line number 36
CMD:bpedit(playerid, params[])
{
if(!PlayerHasBackpack(playerid)) return SendClientMessage(playerid, COLOR_RED, "You do not have a backpack!");
if(PBInfo[playerid][IsWearing] == false) return SendClientMessage(playerid, COLOR_RED, "You are not wearing your backpack!");
EditAttachedObject(playerid, 7);
//SetPVarInt(playerid, "EditingObjectBackpackTrue", 1); If I find the real public OnPlayerEditAttachedObject in the script, check for the PVar and then return 1; so it dont give out the toy menu!
return 1;
}
line number 519 , 542 , 565
TogglePlayerBackpack(playerid, true)