PDA

View Full Version : converting command


aboa
01/12/2012, 04:14 PM
I have some zcmd coomands...can anyone help me to convert it to strcmp

CMD:dynamics(playerid, params[])
{
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
SendClientMessage(playerid, COLOR_GREEN, "__________________________________________________ ___");
SendClientMessage(playerid, COLOR_YELLOW, "DOORS: {FFFFFF}/createdoor /deletedoor /gotodoor /dedit /dused");
SendClientMessage(playerid, COLOR_YELLOW, "GATES: {FFFFFF}/creategate /deletegate /gotogate /gedit /gused");
SendClientMessage(playerid, COLOR_YELLOW, "MAPICONS: {FFFFFF}/createmapicon /deletemapicon /gotomapicon /medit /mused");
SendClientMessage(playerid, COLOR_YELLOW, "BUSINESSES: {FFFFFF}/createbiz /deletebiz /gotobiz /asellbiz /bedit /bused");
SendClientMessage(playerid, COLOR_YELLOW, "HOUSES: {FFFFFF}/createhouse /deletehouse /gotohouse /asellhouse /hedit /hused");
return 1; // DynamicGates
}


CMD:gedit(playerid, params[])
{
new string[128], idx;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(sscanf(params, "s[128]", params))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gedit [option] [gateid]");
SendClientMessage(playerid, COLOR_GREY, "OPTIONS: object | close | open | speed | password");
return 1;
}
if(!strcmp(params, "object", true, 5))
{
new object;
if(sscanf(params, "s[128]ii", params, idx, object)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gedit object [gateid] [objectid]");
if(!GateInfo[idx][gModel]) return SendClientMessage(playerid, COLOR_GREY, "Invalid gate id.");
if(object == 0)
{
format(string, sizeof(string), "%d", object);
cmd_deletegate(playerid, string);
return 1;
}
GateInfo[idx][gModel] = object;
DestroyDynamicObject(GateInfo[idx][gGate]);
GateInfo[idx][gGate] = CreateDynamicObject(GateInfo[idx][gModel], GateInfo[idx][gCX], GateInfo[idx][gCY], GateInfo[idx][gCZ], GateInfo[idx][gCRX], GateInfo[idx][gCRY], GateInfo[idx][gCRZ]);
format(string, sizeof(string), " You have set gate ID %d's object ID to %d.", idx, object);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else if(!strcmp(params, "close", true, 5))
{
if(sscanf(params, "s[128]i", params, idx)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gedit position [gateid]");
if(!GateInfo[idx][gModel]) return SendClientMessage(playerid, COLOR_GREY, "Invalid gate id.");
gEdit[playerid] = 1;
gEditID[playerid] = idx;
GetDynamicObjectPos(GateInfo[idx][gGate], gPos[playerid][0], gPos[playerid][1], gPos[playerid][2]);
GetDynamicObjectRot(GateInfo[idx][gGate], gRot[playerid][0], gRot[playerid][1], gRot[playerid][2]);
EditDynamicObject(playerid, GateInfo[idx][gGate]);
format(string, sizeof(string), " You are now editing gate ID %d's closing position.", idx);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else if(!strcmp(params, "open", true, 4))
{
if(sscanf(params, "s[128]i", params, idx)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gedit open [gateid]");
if(!GateInfo[idx][gModel]) return SendClientMessage(playerid, COLOR_GREY, "Invalid gate id.");
gEdit[playerid] = 2;
gEditID[playerid] = idx;
GetDynamicObjectPos(GateInfo[idx][gGate], gPos[playerid][0], gPos[playerid][1], gPos[playerid][2]);
GetDynamicObjectRot(GateInfo[idx][gGate], gRot[playerid][0], gRot[playerid][1], gRot[playerid][2]);
EditDynamicObject(playerid, GateInfo[idx][gGate]);
format(string, sizeof(string), " You are now editing gate ID %d's opening position.", idx);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else if(!strcmp(params, "speed", true, 5))
{
new Float:speed;
if(sscanf(params, "s[128]if", params, idx, speed)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gedit open [gateid] [speed]");
if(!GateInfo[idx][gModel]) return SendClientMessage(playerid, COLOR_GREY, "Invalid gate id.");
GateInfo[idx][gSpeed] = speed;
format(string, sizeof(string), " You have set gate ID %d's moving speed to %f.", idx, speed);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else if(!strcmp(params, "password", true, 8))
{
new password[256];
if(sscanf(params, "s[128]is[256]", params, idx, password)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gedit open [gateid] [password]");
if(!GateInfo[idx][gModel]) return SendClientMessage(playerid, COLOR_GREY, "Invalid gate id.");
format(GateInfo[idx][gPassword], 256, "%s", password);
format(string, sizeof(string), " You have set gate ID %d's password to {FF6347}%s", idx, password);
SendClientMessage(playerid, COLOR_WHITE, string);
}
return 1;
}

CMD:gotogate(playerid, params[])
{
new idx, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(sscanf(params, "i", idx)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gotogate [gateid]");
if(!GateInfo[idx][gModel]) return SendClientMessage(playerid, COLOR_GREY, "Invalid gate id.");
SetPlayerPos(playerid, GateInfo[idx][gCX], GateInfo[idx][gCY], GateInfo[idx][gCZ]);
format(string, sizeof(string), " You have teleported to gate ID %d.", idx);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}

CMD:gused(playerid, params[])
{
new string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_GREY, "You are not an authorized to use this command.");
SendClientMessage(playerid, COLOR_ORANGE, "[Used Gates]:");
for(new idx=1; idx<MAX_GATES; idx++)
{
if(GateInfo[idx][gModel])
{
format(string, sizeof(string), "ID: %d | Object: %d | Speed: %f | Password: %s", idx, GateInfo[idx][gModel], GateInfo[idx][gSpeed], GateInfo[idx][gPassword]);
SendClientMessage(playerid, COLOR_ORANGE, string);
}
}
return 1;
}

CMD:deletegate(playerid, params[])
{
new idx, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(sscanf(params, "i", idx)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /deletegate [gateid]");
if(!GateInfo[idx][gModel]) return SendClientMessage(playerid, COLOR_GREY, "Invalid gate id.");
GateInfo[idx][gModel] = 0;
GateInfo[idx][gCX] = 0;
GateInfo[idx][gCY] = 0;
GateInfo[idx][gCZ] = 0;
GateInfo[idx][gCRX] = 0;
GateInfo[idx][gCRY] = 0;
GateInfo[idx][gCRZ] = 0;
GateInfo[idx][gOX] = 0;
GateInfo[idx][gOY] = 0;
GateInfo[idx][gOZ] = 0;
GateInfo[idx][gORX] = 0;
GateInfo[idx][gORY] = 0;
GateInfo[idx][gORZ] = 0;
GateInfo[idx][gStatus] = 0;
format(GateInfo[idx][gPassword], 256, "");
GateInfo[idx][gSpeed] = 0;
DestroyDynamicObject(GateInfo[idx][gGate]);
DestroyDynamic3DTextLabel(GateInfo[idx][gText]);
format(string, sizeof(string), "AdmWarn: %s has deleted gate ID %d.", RPN(playerid), idx);
SendAdminMessage(COLOR_DARKRED, 1, string);
Log("logs/gates.log", string);
foreach(Player, i)
{
if(PlayerInfo[i][pGate][0] == idx)
{
PlayerInfo[i][pGate][0] = 0;
SendClientMessage(playerid, COLOR_WHITE, " An administrator has deleted your gate in slot 1.");
format(string, sizeof(string), "AdmWarn: %s has deleted %s's slot 1 gate. (ID: %d)", RPN(playerid), RPN(i), idx);
SendAdminMessage(COLOR_DARKRED, 1, string);
Log("logs/gates.log", string);
}
if(PlayerInfo[i][pGate][1] == idx)
{
PlayerInfo[i][pGate][1] = 0;
SendClientMessage(playerid, COLOR_WHITE, " An administrator has deleted your gate in slot 2.");
format(string, sizeof(string), "AdmWarn: %s has deleted %s's slot 2 gate. (ID: %d)", RPN(playerid), RPN(i), idx);
SendAdminMessage(COLOR_DARKRED, 1, string);
Log("logs/gates.log", string);
}
if(PlayerInfo[i][pGate][2] == idx)
{
PlayerInfo[i][pGate][2] = 0;
SendClientMessage(playerid, COLOR_WHITE, " An administrator has deleted your gate in slot 3.");
format(string, sizeof(string), "AdmWarn: %s has deleted %s's slot 3 gate. (ID: %d)", RPN(playerid), RPN(i), idx);
SendAdminMessage(COLOR_DARKRED, 1, string);
Log("logs/gates.log", string);
}
}
return 1;
}

CMD:creategate(playerid, params[])
{
new string[128], object;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(sscanf(params, "i", object)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /creategate [objectid]");
for(new idx=1; idx<MAX_GATES; idx++)
{
if(!GateInfo[idx][gModel])
{
GetPlayerPos(playerid, GateInfo[idx][gCX], GateInfo[idx][gCY], GateInfo[idx][gCZ]);
GateInfo[idx][gModel] = object;
GateInfo[idx][gCX] = GateInfo[idx][gCX] + 2;
GateInfo[idx][gCY] = GateInfo[idx][gCY] + 2;
GateInfo[idx][gCRX] = 0;
GateInfo[idx][gCRY] = 0;
GateInfo[idx][gCRZ] = 0;
GetPlayerPos(playerid, GateInfo[idx][gOX], GateInfo[idx][gOY], GateInfo[idx][gOZ]);
GateInfo[idx][gOX] = GateInfo[idx][gOX] + 2;
GateInfo[idx][gOY] = GateInfo[idx][gOY] + 2;
GateInfo[idx][gORX] = 0;
GateInfo[idx][gORY] = 0;
GateInfo[idx][gORZ] = 0;
GateInfo[idx][gStatus] = 0;
format(GateInfo[idx][gPassword], 256, "");
GateInfo[idx][gSpeed] = 2;
// Creating
format(string, sizeof(string), "Gate ID: %d", idx);
GateInfo[idx][gGate] = CreateDynamicObject(GateInfo[idx][gModel], GateInfo[idx][gCX], GateInfo[idx][gCY], GateInfo[idx][gCZ], GateInfo[idx][gCRX], GateInfo[idx][gCRY], GateInfo[idx][gCRZ]);
GateInfo[idx][gText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, GateInfo[idx][gCX], GateInfo[idx][gCY], GateInfo[idx][gCZ], 10);
// Text
format(string, sizeof(string), "AdmWarn: %s has created gate ID %d. (Object: %d)", RPN(playerid), idx, object);
SendAdminMessage(COLOR_DARKRED, 1, string);
Log("logs/gates.log", string);
idx = MAX_GATES;
}
}
return 1;
}

CMD:mused(playerid, params[])
{
new string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_GREY, "You are not an authorized to use this command.");
SendClientMessage(playerid, COLOR_ORANGE, "[Used MapIcons]:");
for(new idx=0; idx<MAX_MAPICONS; idx++)
{
if(MapIconInfo[idx][mpType])
{
format(string, sizeof(string), "ID: %d | Pickup: %d", idx, MapIconInfo[idx][mpType]);
SendClientMessage(playerid, COLOR_ORANGE, string);
}
}
return 1;
}

CMD:medit(playerid, params[])
{
new string[128], idx;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(sscanf(params, "s[128]", params))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /medit [option] [mapiconid]");
SendClientMessage(playerid, COLOR_GREY, "OPTIONS: Position | Icon");
return 1;
}
if(!strcmp(params, "position", true, 8))
{
if(sscanf(params, "s[128]i", params, idx)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /medit position [mapiconid]");
if(MapIconInfo[idx][mpType] == 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid mapicon id.");
GetPlayerPos(playerid, MapIconInfo[idx][mpX], MapIconInfo[idx][mpY], MapIconInfo[idx][mpZ]);
DestroyDynamicMapIcon(MapIconInfo[idx][mpID]);
MapIconInfo[idx][mpID] = CreateDynamicMapIcon(MapIconInfo[idx][mpX], MapIconInfo[idx][mpY], MapIconInfo[idx][mpZ], MapIconInfo[idx][mpType], 0 ,0);
format(string, sizeof(string), " You have set mapicon ID %d's position to your coordinates.", idx);
SendClientMessage(playerid, COLOR_WHITE, string);
}
if(!strcmp(params, "icon", true, 4))
{
new pickup;
if(sscanf(params, "s[128]ii", params, idx, pickup)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /medit icon [mapiconid] [iconid]");
if(pickup == 0 || pickup == 1) return SendClientMessage(playerid, COLOR_GREY, "Invalid mapicon type.");
if(MapIconInfo[idx][mpType] == 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid mapicon id.");
MapIconInfo[idx][mpType] = pickup;
DestroyDynamicMapIcon(MapIconInfo[idx][mpID]);
MapIconInfo[idx][mpID] = CreateDynamicMapIcon(MapIconInfo[idx][mpX], MapIconInfo[idx][mpY], MapIconInfo[idx][mpZ], MapIconInfo[idx][mpType], 0 ,0);
format(string, sizeof(string), " You have set mapicon ID %d's icon to %d.", idx, pickup);
SendClientMessage(playerid, COLOR_WHITE, string);
}
return 1;
}

CMD:gotomapicon(playerid, params[])
{
new idx, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(sscanf(params, "i", idx)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gotomapicon [doorid]");
if(!MapIconInfo[idx][mpType]) return SendClientMessage(playerid, COLOR_GREY, "Invalid mapicon id.");
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid, MapIconInfo[idx][mpX], MapIconInfo[idx][mpY], MapIconInfo[idx][mpZ]);
format(string, sizeof(string), " You have teleported to mapicon ID %d.", idx);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}

CMD:deletemapicon(playerid, params[])
{
new idx, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(sscanf(params, "i", idx)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /deletemapicon [mapiconid]");
if(!MapIconInfo[idx][mpType]) return SendClientMessage(playerid, COLOR_GREY, "Invalid mapicon id.");
MapIconInfo[idx][mpType] = 0;
MapIconInfo[idx][mpX] = 0;
MapIconInfo[idx][mpY] = 0;
MapIconInfo[idx][mpZ] = 0;
DestroyDynamicMapIcon(MapIconInfo[idx][mpID]);
format(string, sizeof(string), "AdmWarn: %s has deleted mapicon ID %d.", RPN(playerid), idx);
SendAdminMessage(COLOR_DARKRED, 1, string);
Log("logs/mapicons.log", string);
return 1;
}

CMD:createmapicon(playerid, params[])
{
new string[128], type;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(sscanf(params, "i", type)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /createmapicon [icon]");
if(type == 0 || type == 1) return SendClientMessage(playerid, COLOR_GREY, "Invalid mapicon type.");
for(new idx=0; idx<MAX_MAPICONS; idx++)
{
if(!MapIconInfo[idx][mpType])
{
MapIconInfo[idx][mpType] = type;
GetPlayerPos(playerid, MapIconInfo[idx][mpX], MapIconInfo[idx][mpY], MapIconInfo[idx][mpZ]);
MapIconInfo[idx][mpID] = CreateDynamicMapIcon(MapIconInfo[idx][mpX], MapIconInfo[idx][mpY], MapIconInfo[idx][mpZ], MapIconInfo[idx][mpType], 0 ,0);
format(string, sizeof(string), "AdmWarn: %s has created mapicon ID %d.", RPN(playerid), idx);
SendAdminMessage(COLOR_DARKRED, 1, string);
Log("logs/mapicons.log", string);
idx = MAX_DOORS;
}
}
return 1;
}

CMD:dused(playerid, params[])
{
new string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_GREY, "You are not an authorized to use this command.");
SendClientMessage(playerid, COLOR_ORANGE, "[Used Doors]:");
for(new idx=0; idx<MAX_DOORS; idx++)
{
if(DoorInfo[idx][dType])
{
format(string, sizeof(string), "ID: %d | Pickup: %d | Int: %d | VW: %d | Custom Int: %d | Custom Ext: %d | %s", idx, DoorInfo[idx][dType], DoorInfo[idx][dOInt], DoorInfo[idx][dOVW], DoorInfo[idx][dCInt], DoorInfo[idx][dCExt], DoorInfo[idx][dText]);
SendClientMessage(playerid, COLOR_ORANGE, string);
}
}
return 1;
}

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] < 6) 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;
}
if(!strcmp(params, "pickup", true, 6))
{
new pickup;
if(sscanf(params, "s[128]ii", params, idx, pickup)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dedit pickup [doorid] [pickupid]");
if(DoorInfo[idx][dType] == 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid door id.");
DoorInfo[idx][dType] = pickup;
if(IsValidDynamicPickup(DoorInfo[idx][dPickup]))
{
DestroyDynamicPickup(DoorInfo[idx][dPickup]);
}
DoorInfo[idx][dPickup] = CreateDynamicPickup(DoorInfo[idx][dType], 1, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ], DoorInfo[idx][dOVW], DoorInfo[idx][dOInt]);
format(string, sizeof(string), " You have set door ID %d's pickup to %d", idx, pickup);
SendClientMessage(playerid, COLOR_WHITE, string);
}
if(!strcmp(params, "text", true, 4))
{
if(sscanf(params, "s[128]is[128]", params, idx, text)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dedit text [doorid] [text]");
if(AntiAdv(playerid, params)) return 1;
if(DoorInfo[idx][dType] == 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid door id.");
format(DoorInfo[idx][dText], 128, "%s", text);
format(string, sizeof(string), "ID: %d\n%s", idx, DoorInfo[idx][dText]);
UpdateDynamic3DTextLabelText(DoorInfo[idx][dTextID], COLOR_WHITE, string);
format(string, sizeof(string), " You have set door ID %d's text to %s", idx, text);
SendClientMessage(playerid, COLOR_WHITE, string);
}
if(!strcmp(params, "interior", true, 8))
{
if(sscanf(params, "s[128]i", params, idx, text)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dedit interior [doorid]");
if(DoorInfo[idx][dType] == 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid door id.");
DoorInfo[idx][dIInt] = GetPlayerInterior(playerid);
DoorInfo[idx][dIVW] = GetPlayerVirtualWorld(playerid);
GetPlayerFacingAngle(playerid, DoorInfo[idx][dIA]);
GetPlayerPos(playerid, DoorInfo[idx][dIX], DoorInfo[idx][dIY], DoorInfo[idx][dIZ]);
format(string, sizeof(string), " You have set door ID %d's interior to your coordinates. (Int: %d | VW: %d)", idx, GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid));
SendClientMessage(playerid, COLOR_WHITE, string);
}
if(!strcmp(params, "exterior", true, 8))
{
if(sscanf(params, "s[128]i", params, idx, text)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dedit interior [doorid]");
if(DoorInfo[idx][dType] == 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid door id.");
DoorInfo[idx][dOInt] = GetPlayerInterior(playerid);
DoorInfo[idx][dOVW] = GetPlayerVirtualWorld(playerid);
GetPlayerFacingAngle(playerid, DoorInfo[idx][dOA]);
GetPlayerPos(playerid, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ]);
DestroyDynamicPickup(DoorInfo[idx][dPickup]);
DoorInfo[idx][dPickup] = CreateDynamicPickup(DoorInfo[idx][dType], 1, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ], DoorInfo[idx][dOVW], DoorInfo[idx][dOInt]);
DestroyDynamic3DTextLabel(DoorInfo[idx][dTextID]);
format(string, sizeof(string), "ID: %d\n%s", idx, DoorInfo[idx][dText]);
DoorInfo[idx][dTextID] = CreateDynamic3DTextLabel(string, COLOR_WHITE, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ]+0.3, 15);
format(string, sizeof(string), " You have set door ID %d's exterior to your coordinates. (Int: %d | VW: %d)", idx, GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid));
SendClientMessage(playerid, COLOR_WHITE, string);
}
if(!strcmp(params, "custominterior", true, 14))
{
if(sscanf(params, "s[128]i", params, idx)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dedit custominterior [doorid]");
if(DoorInfo[idx][dType] == 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid door id.");
if(!DoorInfo[idx][dCInt])
{
DoorInfo[idx][dCInt] = 1;
format(string, sizeof(string), " You have set door ID %d to have a custom interior.", idx, text);
}
else
{
DoorInfo[idx][dCInt] = 0;
format(string, sizeof(string), " You have set door ID %d to have a normal interior.", idx, text);
}
SendClientMessage(playerid, COLOR_WHITE, string);
}
if(!strcmp(params, "customexterior", true, 14))
{
if(sscanf(params, "s[128]i", params, idx)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dedit customexterior [doorid]");
if(DoorInfo[idx][dType] == 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid door id.");
if(!DoorInfo[idx][dCExt])
{
DoorInfo[idx][dCExt] = 1;
format(string, sizeof(string), " You have set door ID %d to have a custom exterior.", idx, text);
}
else
{
DoorInfo[idx][dCExt] = 0;
format(string, sizeof(string), " You have set door ID %d to have a normal exterior.", idx, text);
}
SendClientMessage(playerid, COLOR_WHITE, string);
}
return 1;
}

CMD:gotodoor(playerid, params[])
{
new idx, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(sscanf(params, "i", idx)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gotodoor [doorid]");
if(!DoorInfo[idx][dType]) return SendClientMessage(playerid, COLOR_GREY, "Invalid door id.");
SetPlayerInterior(playerid, DoorInfo[idx][dOInt]);
SetPlayerVirtualWorld(playerid, DoorInfo[idx][dOVW]);
SetPlayerPos(playerid, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ]);
format(string, sizeof(string), " You have teleported to door ID %d.", idx);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}

CMD:deletedoor(playerid, params[])
{
new idx, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(sscanf(params, "i", idx)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /deleteedoor [doorid]");
if(!DoorInfo[idx][dType]) return SendClientMessage(playerid, COLOR_GREY, "Invalid door id.");
DoorInfo[idx][dType] = 0;
DoorInfo[idx][dOX] = 0;
DoorInfo[idx][dOY] = 0;
DoorInfo[idx][dOZ] = 0;
DoorInfo[idx][dIX] = 0;
DoorInfo[idx][dIY] = 0;
DoorInfo[idx][dIZ] = 0;
DoorInfo[idx][dOInt] = 0;
DoorInfo[idx][dOVW] = 0;
DoorInfo[idx][dIInt] = 0;
DoorInfo[idx][dIVW] = 0;
DoorInfo[idx][dCInt] = 0;
DoorInfo[idx][dCExt] = 0;
format(DoorInfo[idx][dText], 32, "");
DestroyDynamicPickup(DoorInfo[idx][dPickup]);
DestroyDynamic3DTextLabel(DoorInfo[idx][dTextID]);
format(string, sizeof(string), "AdmWarn: %s has deleted door ID %d.", RPN(playerid), idx);
SendAdminMessage(COLOR_DARKRED, 1, string);
Log("logs/doors.log", string);
return 1;
}

CMD:createdoor(playerid, params[])
{
new string[128], type;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(sscanf(params, "i", type)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /createdoor [pickupid]");
if(type == 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid door type.");
for(new idx=0; idx<MAX_DOORS; idx++)
{
if(!DoorInfo[idx][dType])
{
GetPlayerPos(playerid, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ]);
DoorInfo[idx][dType] = type;
DoorInfo[idx][dOInt] = GetPlayerInterior(playerid);
DoorInfo[idx][dOVW] = GetPlayerVirtualWorld(playerid);
GetPlayerFacingAngle(playerid, DoorInfo[idx][dOA]);
// Creating the door
DoorInfo[idx][dPickup] = CreateDynamicPickup(DoorInfo[idx][dType], 1, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ], DoorInfo[idx][dOVW], DoorInfo[idx][dOInt]);
format(string, sizeof(string), "ID: %d\n/dedit to set the text", idx);
DoorInfo[idx][dTextID] = CreateDynamic3DTextLabel(string, COLOR_WHITE, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ]+0.3, 15);
format(string, sizeof(string), "AdmWarn: %s has created door ID %d. (Int: %d | VW: %d)", RPN(playerid), idx, DoorInfo[idx][dOInt], DoorInfo[idx][dOVW]);
SendAdminMessage(COLOR_DARKRED, 1, string);
Log("logs/doors.log", string);
idx = MAX_DOORS;
}
}
return 1;
}

CMD:bused(playerid, params[])
{
new string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
SendClientMessage(playerid, COLOR_ORANGE, "[Used Businesses]:");
for(new idx=1; idx<MAX_BIZ; idx++)
{
if(BizInfo[idx][bType])
{
format(string, sizeof(string), "ID: %d | Type: %s | Level: %d | Price: $%d | Products: %d | Vault: $%d | Owner: %s", idx, RBT(idx), BizInfo[idx][bLevel], BizInfo[idx][bPrice],BizInfo[idx][bProducts], BizInfo[idx][bMoney], BizInfo[idx][bOwner]);
SendClientMessage(playerid, COLOR_ORANGE, string);
}
}
return 1;
}

Lz
01/12/2012, 04:17 PM
Wouldn't it just be easier to get the ZCMD include and just use them? ZCMD is much faster to process too so it would be beneficial.

Otheriwse use this (http://******************/post/Strcmp_to_Zcmd_Converter-COD-filterscript-other-5850/)

- Edit hmm blanking my hyperlink..

http://******************/post/Strcmp_to_Zcmd_Converter-COD-filterscript-other-5850/

- edit 2 Seems i can't post the site.. :S ****** ZCMD to Strcmp converter