[Question] I need help making doors VIP only.
#1

Hi,
I'm a bit new to scripting and I have a script that my friend gave me, It's really good and all but the only thing it doesn't have is a /dedit for VIP, Admin, and faction to only allow them through a Dynamic Door and I would have no clue on how to make one. So if anyone with a good scripting mind could help, I would appreciate it,
Thanks.

Here is a samp for the /dedit so someone will know how it works.

CMD:dedit(playerid, params[])
{
new idx, text[128], string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not an authorized to use this command.");
if(sscanf(params, "s[128]", params))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dedit [option] [doorid]");
SendClientMessage(playerid, COLOR_GREY, "OPTIONS: Pickup | Text | Interior | Exterior | CustomInterior | CustomExterior");
return 1;
}
Reply
#2

what are the parameters of vip sistem?
Reply
#3

Quote:
Originally Posted by PT
Посмотреть сообщение
what are the parameters of vip sistem?
Sorry like I said I'm new to scripting, what would that mean?

If you mean levels of the VIP its 1, 2, 3, and 4 (Bronze, Silver, Gold, Platinum)
Reply
#4

only put a vip command here
Reply
#5

Quote:
Originally Posted by PT
Посмотреть сообщение
only put a vip command here
The cmd to make VIP?
Reply
#6

no, one cmd only vips use
Reply
#7

Enum please.

It'll look something like:
pawn Код:
enum PlayerInfo
{
    VIP,
    Admin,
}
new pInfo[MAX_PLAYERS][PlayerInfo];
Reply
#8

Maybe you're using NGRP script. so you can use /ddedit exterior/interior [DoorId]..
Quote:

CMD:ddedit(playerid, params[])
{
if(PlayerInfo[playerid][pAdminDuty] == 0) return SendClientMessage(playerid, -1, "You must be on Admin Duty to use this Command!");
if(PlayerInfo[playerid][pAdmin] < 4)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use that command!");
return 1;
}

new string[128], choice[32], doorid, amount;
if(sscanf(params, "s[32]dD", choice, doorid, amount))
{
SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /ddedit [name] [doorid] [amount]");
SendClientMessageEx(playerid, COLOR_GREY, "Available names: Exterior, Interior, CustomInterior, CustomExterior, VIP");
SendClientMessageEx(playerid, COLOR_GREY, "Family, Faction, Wanted, Admin, VehicleAble, Color, PickupModel, Delete");
return 1;
}

if(doorid >= MAX_DDOORS)
{
SendClientMessageEx( playerid, COLOR_WHITE, "Invalid Door ID!");
return 1;
}

if(strcmp(choice, "interior", true) == 0)
{
GetPlayerPos(playerid, DDoorsInfo[doorid][ddInteriorX], DDoorsInfo[doorid][ddInteriorY], DDoorsInfo[doorid][ddInteriorZ]);
GetPlayerFacingAngle(playerid, DDoorsInfo[doorid][ddInteriorA]);
DDoorsInfo[doorid][ddInteriorInt] = GetPlayerInterior(playerid);
DDoorsInfo[doorid][ddInteriorVW] = GetPlayerVirtualWorld(playerid);
SendClientMessageEx(playerid, COLOR_WHITE, "You have changed the interior!");
SaveDynamicDoors();
format(string, sizeof(string), "%s has edited DoorID %d's Interior.", GetPlayerNameEx(playerid), doorid);
Log("logs/ddedit.log", string);
return 1;
}
else if(strcmp(choice, "custominterior", true) == 0)
{
if(DDoorsInfo[doorid][ddCustomInterior] == 0)
{
DDoorsInfo[doorid][ddCustomInterior] = 1;
SendClientMessageEx(playerid, COLOR_WHITE, "Door set to custom interior!");
}
else
{
DDoorsInfo[doorid][ddCustomInterior] = 0;
SendClientMessageEx(playerid, COLOR_WHITE, "Door set to normal (not custom) interior!");
}
SaveDynamicDoors();
format(string, sizeof(string), "%s has edited DoorID %d's CustomInterior.", GetPlayerNameEx(playerid), doorid);
Log("logs/ddedit.log", string);
return 1;
}
else if(strcmp(choice, "customexterior", true) == 0)
{
if(DDoorsInfo[doorid][ddCustomExterior] == 0)
{
DDoorsInfo[doorid][ddCustomExterior] = 1;
SendClientMessageEx(playerid, COLOR_WHITE, "Door set to custom exterior!");
}
else
{
DDoorsInfo[doorid][ddCustomExterior] = 0;
SendClientMessageEx(playerid, COLOR_WHITE, "Door set to normal (not custom) exterior!");
}
SaveDynamicDoors();
format(string, sizeof(string), "%s has edited DoorID %d's CustomExterior.", GetPlayerNameEx(playerid), doorid);
Log("logs/ddedit.log", string);
return 1;
}
else if(strcmp(choice, "exterior", true) == 0)
{
GetPlayerPos(playerid, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ]);
GetPlayerFacingAngle(playerid, DDoorsInfo[doorid][ddExteriorA]);
DDoorsInfo[doorid][ddExteriorVW] = GetPlayerVirtualWorld(playerid);
DDoorsInfo[doorid][ddExteriorInt] = GetPlayerInterior(playerid);
SendClientMessageEx(playerid, COLOR_WHITE, "You have changed the exterior!");
if(IsValidDynamicPickup(DDoorsInfo[doorid][ddPickupID])) DestroyDynamicPickup(DDoorsInfo[doorid][ddPickupID]);
if(IsValidDynamic3DTextLabel(DDoorsInfo[doorid][ddTextID])) DestroyDynamic3DTextLabel(DDoorsInfo[doorid][ddTextID]);
CreateDynamicDoor(doorid);
SaveDynamicDoors();
format(string, sizeof(string), "%s has edited DoorID %d's Exterior.", GetPlayerNameEx(playerid), doorid);
Log("logs/ddedit.log", string);
}
else if(strcmp(choice, "vip", true) == 0)
{
DDoorsInfo[doorid][ddVIP] = amount;

format(string, sizeof(string), "You have changed the VIP Level to %d.", amount);
SendClientMessageEx(playerid, COLOR_WHITE, string);

SaveDynamicDoors();
format(string, sizeof(string), "%s has edited DoorID %d's VIP Level.", GetPlayerNameEx(playerid), doorid);
Log("logs/ddedit.log", string);
return 1;
}
else if(strcmp(choice, "family", true) == 0)
{
DDoorsInfo[doorid][ddFamily] = amount;

format(string, sizeof(string), "You have changed the Family to %d.", amount);
SendClientMessageEx(playerid, COLOR_WHITE, string);

SaveDynamicDoors();
format(string, sizeof(string), "%s has edited DoorID %d's Family.", GetPlayerNameEx(playerid), doorid);
Log("logs/ddedit.log", string);
return 1;
}
else if(strcmp(choice, "faction", true) == 0)
{
DDoorsInfo[doorid][ddFaction] = amount;

format(string, sizeof(string), "You have changed the Faction to %d.", amount);
SendClientMessageEx(playerid, COLOR_WHITE, string);

SaveDynamicDoors();
format(string, sizeof(string), "%s has edited DoorID %d's Faction.", GetPlayerNameEx(playerid), doorid);
Log("logs/ddedit.log", string);
return 1;
}
else if(strcmp(choice, "admin", true) == 0)
{
DDoorsInfo[doorid][ddAdmin] = amount;

format(string, sizeof(string), "You have changed the Admin Level to %d.", amount);
SendClientMessageEx(playerid, COLOR_WHITE, string);

SaveDynamicDoors();
format(string, sizeof(string), "%s has edited DoorID %d's Admin Level.", GetPlayerNameEx(playerid), doorid);
Log("logs/ddedit.log", string);
return 1;
}
else if(strcmp(choice, "wanted", true) == 0)
{
DDoorsInfo[doorid][ddWanted] = amount;

format(string, sizeof(string), "You have changed the Wanted to %d.", amount);
SendClientMessageEx(playerid, COLOR_WHITE, string);

SaveDynamicDoors();
format(string, sizeof(string), "%s has edited DoorID %d's Wanted.", GetPlayerNameEx(playerid), doorid);
Log("logs/ddedit.log", string);
return 1;
}
else if(strcmp(choice, "vehicleable", true) == 0)
{
DDoorsInfo[doorid][ddVehicleAble] = amount;

format(string, sizeof(string), "You have changed the VehicleAble to %d.", amount);
SendClientMessageEx(playerid, COLOR_WHITE, string);

SaveDynamicDoors();
format(string, sizeof(string), "%s has edited DoorID %d's VehicleAble.", GetPlayerNameEx(playerid), doorid);
Log("logs/ddedit.log", string);
return 1;
}
else if(strcmp(choice, "color", true) == 0)
{
DDoorsInfo[doorid][ddColor] = amount;

format(string, sizeof(string), "You have changed the Color to %d.", amount);
SendClientMessageEx(playerid, COLOR_WHITE, string);

if(IsValidDynamicPickup(DDoorsInfo[doorid][ddPickupID])) DestroyDynamicPickup(DDoorsInfo[doorid][ddPickupID]);
if(IsValidDynamic3DTextLabel(DDoorsInfo[doorid][ddTextID])) DestroyDynamic3DTextLabel(DDoorsInfo[doorid][ddTextID]);
CreateDynamicDoor(doorid);

SaveDynamicDoors();
format(string, sizeof(string), "%s has edited DoorID %d's Color.", GetPlayerNameEx(playerid), doorid);
Log("logs/ddedit.log", string);
return 1;
}
else if(strcmp(choice, "pickupmodel", true) == 0)
{
DDoorsInfo[doorid][ddPickupModel] = amount;

format(string, sizeof(string), "You have changed the PickupModel to %d.", amount);
SendClientMessageEx(playerid, COLOR_WHITE, string);

if(IsValidDynamicPickup(DDoorsInfo[doorid][ddPickupID])) DestroyDynamicPickup(DDoorsInfo[doorid][ddPickupID]);
if(IsValidDynamic3DTextLabel(DDoorsInfo[doorid][ddTextID])) DestroyDynamic3DTextLabel(DDoorsInfo[doorid][ddTextID]);
CreateDynamicDoor(doorid);

SaveDynamicDoors();
format(string, sizeof(string), "%s has edited DoorID %d's PickupModel.", GetPlayerNameEx(playerid), doorid);
Log("logs/ddedit.log", string);
return 1;
}
else if(strcmp(choice, "delete", true) == 0)
{
if (DDoorsInfo[doorid][ddDescription] == 0) {
format(string, sizeof(string), "DoorID %d does not exist.", doorid);
SendClientMessageEx(playerid, COLOR_WHITE, string);
return 1;
}
if(IsValidDynamicPickup(DDoorsInfo[doorid][ddPickupID])) DestroyDynamicPickup(DDoorsInfo[doorid][ddPickupID]);
DestroyDynamic3DTextLabel(DDoorsInfo[doorid][ddTextID]);
DDoorsInfo[doorid][ddDescription] = 0;
DDoorsInfo[doorid][ddCustomInterior] = 0;
DDoorsInfo[doorid][ddExteriorVW] = 0;
DDoorsInfo[doorid][ddExteriorInt] = 0;
DDoorsInfo[doorid][ddInteriorVW] = 0;
DDoorsInfo[doorid][ddInteriorInt] = 0;
DDoorsInfo[doorid][ddExteriorX] = 0;
DDoorsInfo[doorid][ddExteriorY] = 0;
DDoorsInfo[doorid][ddExteriorZ] = 0;
DDoorsInfo[doorid][ddExteriorA] = 0;
DDoorsInfo[doorid][ddInteriorX] = 0;
DDoorsInfo[doorid][ddInteriorY] = 0;
DDoorsInfo[doorid][ddInteriorZ] = 0;
DDoorsInfo[doorid][ddInteriorA] = 0;
DDoorsInfo[doorid][ddCustomExterior] = 0;
DDoorsInfo[doorid][ddVIP] = 0;
DDoorsInfo[doorid][ddFamily] = 0;
DDoorsInfo[doorid][ddFaction] = 0;
DDoorsInfo[doorid][ddAdmin] = 0;
DDoorsInfo[doorid][ddWanted] = 0;
DDoorsInfo[doorid][ddVehicleAble] = 0;
DDoorsInfo[doorid][ddColor] = 0;
DDoorsInfo[doorid][dPass] = 0;
DDoorsInfo[doorid][dLocked] = 0;
SaveDynamicDoors();
format(string, sizeof(string), "You have deleted DoorID %d.", doorid);
SendClientMessageEx(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "%s has deleted DoorID %d.", GetPlayerNameEx(playerid), doorid);
Log("logs/ddedit.log", string);
return 1;
}
return 1;
}

or if you mean this.. so /dedit [pot/crack] [amount]
Quote:

CMD:dedit(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1337)
{
SendClientMessageEx(playerid, COLOR_GRAD2, " You are not an Admin!");
return 1;
}

new string[128], choice[32], amount;
if(sscanf(params, "s[32]d", choice, amount))
{
SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /dedit [name] [amount]");
SendClientMessageEx(playerid, COLOR_GREY, "Available names: Pot, Crack");
return 1;
}

if(strcmp(choice,"pot",true) == 0)
{
for(new h = 0; h < sizeof(Points); h++)
{
if(Points[h][Type] == 3)
{
Points[h][Stock] = amount;
format(string, sizeof(string), " POT AVAILABLE: %d/1000.", Points[h][Stock]);
UpdateDynamic3DTextLabelText(Points[h][TextLabel], COLOR_YELLOW, string);
SendClientMessageEx(playerid, COLOR_WHITE, " You have successfully changed the Drug House available pot!");
}
}
}
else if(strcmp(choice,"crack",true) == 0)
{
for(new h = 0; h < sizeof(Points); h++)
{
if(Points[h][Type] == 4)
{
Points[h][Stock] = amount;
format(string, sizeof(string), " CRACK AVAILABLE: %d/500.", Points[h][Stock]);
UpdateDynamic3DTextLabelText(Points[h][TextLabel], COLOR_YELLOW, string);
SendClientMessageEx(playerid, COLOR_WHITE, " You have successfully changed the Crack Lab available crack!");
}
}
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, " Not a valid name.");
return 1;
}
return 1;
}

IF it helped you +1Reputation me. thanks..
Reply
#9

Quote:
Originally Posted by PT
Посмотреть сообщение
only put a vip command here
This is a VIP Command, and to the others, this script is pretty different to others and is /dedit not for drugs, for editing dynamic doors.

Quote:

CMD:vipbuddy(playerid, params[])
{
new playerb, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pVIP] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(PlayerInfo[playerid][pVIPBuddy])
{
format(string, sizeof(string), " You need to wait %d more hours before giving someone else Bronze VIP.", PlayerInfo[playerid][pVIPBuddy]);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /vipbuddy [playerid]");
if(PlayerInfo[playerb][pVIP]) return SendClientMessage(playerid, COLOR_GREY, "Player is already VIP");
PlayerInfo[playerid][pVIPBuddy] = 12;
PlayerInfo[playerb][pVIP] = 1;
PlayerInfo[playerb][pVIPTemp] = 60;
format(string, sizeof(string), " You have given %s temporary Bronze VIP package for an hour.", RPN(playerb));
SendClientMessage(playerid, COLOR_VIP, string);
format(string, sizeof(string), " %s has given you temporary Bronze VIP package for an hour.", RPN(playerid));
SendClientMessage(playerb, COLOR_VIP, string);
return 1;
}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)