rendered paste body // Alex "Y_Less" Coles Landgrab code#if defined SAFE_MONEY #define LGGivePlayerMoney(%1,%2); SafeGivePlayerMoney(%1, %2);#else #define LGGivePlayerMoney(%1,%2); GivePlayerMoney(%1, %2);#endif/*=================== Variables===================*/static gLGLast[MAX_PLAYERS][LG_LAST];static gCurArea[MAX_PLAYERS] = {-1, ...};static gLGPlayerWep[MAX_PLAYERS];static gLGBankBal[MAX_PLAYERS];/*=================== Functions===================*/LGConnect(playerid){ gLGLast[playerid][LTYPE] = LG_NO_LAST; gLGBankBal[playerid] = 0; gLGPlayerWep[playerid] = 0;}LGGetCurCP(playerid){ #pragma unused LGGetCurCP return gCurArea[playerid];}LGCP(playerid, Float:x, Float:y, Float:z, Float:size){ #pragma unused LGCP new Float:p[3]; GetPlayerPos(playerid, p[0], p[1], p[2]); DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, p[0], p[1], p[2], size); DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, x, y, z, size);}LGDisconnect(playerid){ for (new i = 0; i < sizeof (gLGPoints); i++) { if (gLGPoints[i][MOWNER] == playerid) { if (gLGPoints[i][MSPECIAL] & LG_SELL) { gLGPoints[i][MSPECIAL] &= LG_NO_CHECKPOINT ^ -1; } gLGPoints[i][MOWNER] = INVALID_PLAYER_ID; } }}public LG_Property_Loop(){ //print("hi"); static playerloops[MAX_PLAYERS] = {0, ...}; static Float:lastgoodpos[MAX_PLAYERS][3]; static payloops = 0; new Float:x, Float:y, Float:z; new t, done, ng, pars; // Players team, CP done, No go, Parameters // Determine payments for players new money[MAX_PLAYERS]; if (payloops == LG_PAY_LOOPS) { for (new j = 0; j < sizeof (gLGPoints); j++) { if (gLGPoints[j][MOWNER] != INVALID_PLAYER_ID) money[gLGPoints[j][MOWNER]] += gLGPoints[j][MOPTION_2]; } payloops = 0; } // Determine position and effect for (new j = 0; j < MAX_PLAYERS; j++) { if (IsPlayerConnected(j)) { if (money[j] != 0) { new string[64]; format(string, sizeof (string), "You earnt %d from your properties", money[j]); LGGivePlayerMoney(j, money[j]); SendClientMessage(j, LG_MSG_COLOR, string); } GetPlayerPos(j, x, y, z); t = gTeam[j]; done = 0; ng = 0; // No go pars = 0; for (new i = 0; i < sizeof (gLGPoints); i++) { new team = gLGPoints[i][MTEAMS]; //printf("%d %d %d %d %d %d", t, team, LG_NOT_TEAMS, LG_NOT_TEAMS & team, t & team, (LG_NOT_TEAMS & team) ^ (t & team)); if (((LG_NOT_TEAMS & team) ? 1 : 0) ^ ((t & team) ? 1 : 0)) { // Allows multiple teams to use an area. Also allows // overlapping ares to be defined for different teams // XOR command allows team exclusion - allows teamed admins pars = gLGPoints[i][MSPECIAL]; // Save the parameters if (pars & LG_DEFAULT && gLGLast[j][LTYPE] == LG_NO_LAST) { gLGLast[j][LTYPE] = i; } if (x > gLGPoints[i][MAREA_MIN_X] && x < gLGPoints[i][MAREA_MAX_X] && y > gLGPoints[i][MAREA_MIN_Y] && y < gLGPoints[i][MAREA_MAX_Y] && ((pars & LG_INTERIOR) ? z > 800.0 : z < 800.0)) { done = 1; switch (pars & 0xFFFF) // Check the type (lower 2 bytes) { case LG_MONEY_AREA: // Area to hold for money { playerloops[j]++; if (playerloops[j] == gLGPoints[i][MOPTION_1]) { playerloops[j] = 0; LGGivePlayerMoney(j, gLGPoints[i][MOPTION_2]); } } case LG_FORBIDDEN: // Forbidden area { ng = 1; SetPlayerPos(j, lastgoodpos[j][0], lastgoodpos[j][1], lastgoodpos[j][2]); GameTextForPlayer(j, "~r~Forbidden area!~n~Keep out!", 5000, 3); // Place the player at their last good position } case LG_PROPERTY: { if (!LGRequiredLast(i, j)) { done = 0; } } case LG_NAMED_AREA: { if (LGRequiredLast(i, j)) { GameTextForPlayer(j, gLGPoints[i][MNAME], 5000, 1); } } case LG_MONEY_POINT: { if (IsPlayerInCheckpoint(j)) { playerloops[j]++; if (playerloops[j] == gLGPoints[i][MOPTION_1]) { playerloops[j] = 0; LGGivePlayerMoney(j, gLGPoints[i][MOPTION_2]); } } } case LG_SPECIAL_AREA: { #if defined LG_SPECIAL_AREA_CODE LG_SPECIAL_AREA_CODE(j, i); #else print("Warning: LG_SPECIAL_AREA_CODE not found"); #endif } } if (done) { //print("hi"); if (!ng && gCurArea[j] != i) // If we wern't here before { //print("there"); playerloops[j] = 0; gCurArea[j] = i; // We're in here now DisablePlayerCheckpoint(j); // Remove any old ones if (!(pars & LG_NO_CHECKPOINT)) // !no checkpoint? { //print("err..."); LGCP(j, gLGPoints[i][MCP_X], gLGPoints[i][MCP_Y], gLGPoints[i][MCP_Z], gLGPoints[i][MCP_S]); } if (pars & LG_NAME) // Entry name? { GameTextForPlayer(j, gLGPoints[i][MNAME], 5000, 3); } if (pars & LG_CP_STAY) { gLGLast[j][LLAST_X] = gLGPoints[i][MCP_X]; gLGLast[j][LLAST_Y] = gLGPoints[i][MCP_Y]; gLGLast[j][LLAST_Z] = gLGPoints[i][MCP_Z]; gLGLast[j][LLAST_S] = gLGPoints[i][MCP_S]; gLGLast[j][LTYPE] = i; } } break; } } } } if (!done) // We're not in an area atm { done = gLGLast[j][LTYPE]; // Variable reassignment if (done < sizeof (gLGPoints) && done >= 0) { LGCP(j, gLGPoints[done][MCP_X], gLGPoints[done][MCP_Y], gLGPoints[done][MCP_Z], gLGPoints[done][MCP_S]); gCurArea[j] = done; } else { if (done == LG_INVALID_LAST) { if (gCurArea[j] != -1) { DisablePlayerCheckpoint(j); LGCP(j, gLGLast[j][LLAST_X], gLGLast[j][LLAST_Y], gLGLast[j][LLAST_Z], gLGLast[j][LLAST_S]); } } else { DisablePlayerCheckpoint(j); } gCurArea[j] = -1; } } if (!ng) // We're not in a forbidden area { lastgoodpos[j][0] = x; lastgoodpos[j][1] = y; lastgoodpos[j][2] = z; } } } payloops++;}LGRequiredLast(curcp, playerid){ #pragma unused LGRequiredLast // Checks if the last area is in the list of the current areas neighbors new i, k = gCurArea[playerid]; if (k == curcp) return 1; for (i = 0; i < 16; i++) { new j = gLGPoints[curcp][MLINKS][i]; if (j == LG_NO_LAST) break; else if (j == k) return 1; } if (i) { return 0; } return 1;}LGSetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size){ #pragma unused LGSetPlayerCheckpoint LGCP(playerid, x, y, z, size); gLGLast[playerid][LLAST_X] = x; gLGLast[playerid][LLAST_Y] = y; gLGLast[playerid][LLAST_Z] = z; gLGLast[playerid][LLAST_S] = size; gLGLast[playerid][LTYPE] = LG_INVALID_LAST;}LGDisablePlayerCheckpoint(playerid){ #pragma unused LGDisablePlayerCheckpoint DisablePlayerCheckpoint(playerid); gLGLast[playerid][LTYPE] = LG_NO_LAST;}dcmd_properties(playerid, text[]){ static props, pages, d = 1; if (d) { props = LG_buyable_properties(); pages = (props + 7) / 8; //props / 8 + props % 8 ? 1 : 0); //(sizeof (gLGPoints) + 7) / 8 d = 0; } new page = strval(text); new string[64]; if (props > 8) { if (page) { if (page <= pages) { for (new i = 0, j = 0, k = (page - 1) * 8, n = k + 8; i < sizeof (gLGPoints) && j < n; i++) { if (gLGPoints[i][MSPECIAL] & 0xFFFF == LG_PROPERTY) { if (j >= k) { format(string, sizeof (string), "\"%s\". Owner: %s", gLGPoints[i][MNAME], LG_ret_owner(gLGPoints[i][MOWNER])); SendClientMessage(playerid, LG_MSG_COLOR, string); } j++; } } } else { format(string, sizeof (string), "Use /properties# where # is 1 - %d to list", pages); SendClientMessage(playerid, LG_MSG_COLOR, string); } } else { SendClientMessage(playerid, LG_MSG_COLOR, "More than 8 buyable properties found"); format(string, sizeof (string), "Use /properties# where # is 1 - %d to list", pages); SendClientMessage(playerid, LG_MSG_COLOR, string); } } else { for (new j = 0, i = 0; i < props && j < sizeof (gLGPoints); j++) { if (gLGPoints[j][MSPECIAL] & 0xFFFF == LG_PROPERTY) { format(string, sizeof (string), "\"%s\". Owner: %s", gLGPoints[j][MNAME], LG_ret_owner(gLGPoints[j][MOWNER])); SendClientMessage(playerid, LG_MSG_COLOR, string); i++; } } } return 1;}LGValidCP(playerid, cptype){ if (IsPlayerInCheckpoint(playerid)) { new type = gCurArea[playerid]; if (type >= 0 && type < sizeof (gLGPoints)) { if (gLGPoints[type][MSPECIAL] & 0xFFFF == cptype) return 1; } } return 0;}dcmd_listweapons(playerid, text[]){ static pages = (sizeof (gLGWepDat) + 7) / 8; if (LGValidCP(playerid, LG_AMMU)) { new page = strval(text); new string[64]; if (pages > 1) { if (page) { if (page <= pages) { for (new i = 0, j = (page - 1) * 8; i < 8 && j < sizeof (gLGWepDat); i++, j++) { format(string, sizeof (string), "%d: %s. Cost: %d", j, gLGWepDat[j][WNAME], gLGWepDat[j][WPRICE]); SendClientMessage(playerid, LG_MSG_COLOR, string); } } else { format(string, sizeof (string), "Use /listweapons# where # is 1 - %d to list", pages); SendClientMessage(playerid, LG_MSG_COLOR, string); } } else { SendClientMessage(playerid, LG_MSG_COLOR, "More than 8 weapons found"); format(string, sizeof (string), "Use /listweapons# where # is 1 - %d to list", pages); SendClientMessage(playerid, LG_MSG_COLOR, string); } } else { for (new j = 0; j < sizeof (gLGWepDat); j++) { format(string, sizeof (string), "%d, %s. Cost: %d", j, gLGWepDat[j][WNAME], gLGWepDat[j][WPRICE]); SendClientMessage(playerid, LG_MSG_COLOR, string); } } } else { SendClientMessage(playerid, LG_MSG_COLOR, "You can't use that command here"); } return 1;}dcmd_teleport(playerid, text[]){ if (LGValidCP(playerid, LG_TELEPORT)) { new point = gCurArea[playerid]; new i; for (i = 0; i < LG_LINK_COUNT; i++) { if (gLGPoints[point][MLINKS][i] == -1) break; } if (text[0]) { new dest = strval(text); if (dest >=0 && dest < i) { dest = gLGPoints[point][MLINKS][dest]; new c = gLGPoints[point][MOPTION_1]; if (c) { if (GetPlayerMoney(playerid) >= c) { SetPlayerInterior(playerid, gLGPoints[dest][MOPTION_1]); SetPlayerPos(playerid, gLGPoints[dest][MCP_X], gLGPoints[dest][MCP_Y], gLGPoints[dest][MCP_Z]); SetPlayerFacingAngle(playerid, gLGPoints[dest][MCP_S]); GivePlayerMoney(playerid, 0 - c); } else { SendClientMessage(playerid, LG_MSG_COLOR, "Insufficient funds"); } } else { SetPlayerInterior(playerid, gLGPoints[dest][MOPTION_1]); SetPlayerPos(playerid, gLGPoints[dest][MCP_X], gLGPoints[dest][MCP_Y], gLGPoints[dest][MCP_Z]); SetPlayerFacingAngle(playerid, gLGPoints[dest][MCP_S]); } } else { SendClientMessage(playerid, LG_MSG_COLOR, "Not a valid destination"); SendClientMessage(playerid, LG_MSG_COLOR, "Type \"/listdest\" for a list of destinations"); } } else { SendClientMessage(playerid, LG_MSG_COLOR, "You must enter a destination number"); SendClientMessage(playerid, LG_MSG_COLOR, "Type \"/listdest\" for a list of destinations"); } } else { SendClientMessage(playerid, LG_MSG_COLOR, "You can't use that command here"); } return 1;}dcmd_listdest(playerid, text[]){ //static pages = (sizeof (gLGWepDat) + 7) / 8; if (LGValidCP(playerid, LG_TELEPORT)) { new point = gCurArea[playerid]; new num; for (num = 0; num < LG_LINK_COUNT; num++) { if (gLGPoints[point][MLINKS][num] == -1) break; /*if (MOPTION_1) { new string[256]; format(string, sizeof (string), "Cost: %d. Type \"/teleport x\" where x is", gLGPoints[point][MNAME], LG_ret_owner(owner)); SendClientMessage(playerid, LG_MSG_COLOR, string); SendClientMessage(playerid, LG_MSG_COLOR, "your required destination to teleport."); SendClientMessage(playerid, LG_MSG_COLOR, "Type \"/listdest\" for a list of destinations"); } else { if (i == 1) { new j = gLGPoints[point][MLINKS][0]; SetPlayerPos(playerid, gLGPoints[j][MCP_X], gLGPoints[j][MCP_Y], gLGPoints[j][MCP_Z]); } else if (i) { SendClientMessage(playerid, LG_MSG_COLOR, "Type \"/listdest\" for a list of destinations"); } } if (*/ } new pages = (num + 7) / 8; new page = strval(text); new string[64]; if (pages > 1) { if (page) { if (page <= pages) { for (new i = 0, j = (page - 1) * 8; i < 8 && j < num; i++, j++) { format(string, sizeof (string), "%d: %s", j, gLGPoints[gLGPoints[point][MLINKS][j]][MNAME]); SendClientMessage(playerid, LG_MSG_COLOR, string); } } else { format(string, sizeof (string), "Use /listdest# where # is 1 - %d to list", pages); SendClientMessage(playerid, LG_MSG_COLOR, string); } } else { SendClientMessage(playerid, LG_MSG_COLOR, "More than 8 destinations found"); format(string, sizeof (string), "Use /listdest# where # is 1 - %d to list", pages); SendClientMessage(playerid, LG_MSG_COLOR, string); } } else { for (new j = 0; j < num; j++) { format(string, sizeof (string), "%d: %s", j, gLGPoints[gLGPoints[point][MLINKS][j]][MNAME]); SendClientMessage(playerid, LG_MSG_COLOR, string); } } } else { SendClientMessage(playerid, LG_MSG_COLOR, "You can't use that command here"); } return 1;}dcmd_buyweapon(playerid, text[]){ if (LGValidCP(playerid, LG_AMMU)) { if (LGIsNumeric(text)) { new num = strval(text); if (num >= 0 && num < sizeof (gLGWepDat)) { if (gLGPlayerWep[playerid] & (1 << num)) { // Has the weapon printf("%d, %d, %d, %d", gLGPlayerWep[playerid], 1 << num, gLGPlayerWep[playerid] & (1 << num), num); SendClientMessage(playerid, LG_WRN_COLOR, "You already have this weapon"); } else { new price = gLGWepDat[num][WPRICE]; if (GetPlayerMoney(playerid) >= price) { LGGivePlayerMoney(playerid, 0 - price); SendClientMessage(playerid, LG_MSG_COLOR, "Spawn weapon purchased"); gLGPlayerWep[playerid] |= (1 << num); } else { SendClientMessage(playerid, LG_WRN_COLOR, "Insufficient funds"); } } } else { // Not a weapon SendClientMessage(playerid, LG_WRN_COLOR, "Invalid weapon id"); } } else { // Not a number SendClientMessage(playerid, LG_WRN_COLOR, "Invalid weapon id"); } } else { SendClientMessage(playerid, LG_MSG_COLOR, "You can't use that command here"); } return 1;}LG_buyable_properties(){ new j = 0; for (new i = 0; i < sizeof (gLGPoints); i++) { if (gLGPoints[i][MSPECIAL] & 0xFFFF == LG_PROPERTY) j++; } return j;}/*LG_list_pages(playerid, pages){ SendClientMessage(playerid, LG_MSG_COLOR, "More than 8 buyable properties found" new string[256]; format(string, sizeof (string), "Use /properties# where # is 1 - %d to list", pages); for (new i = 0; i < sizeof (gLGPoints); i += 8) { format(string, sizeof (string), "\"%s\".print Owner: %s", gLGPoints[i][MNAME], LG_ret_owner(gLGPoints[i][MOWNER])); SendClientMessage(playerid, LG_MSG_COLOR, string); }}*/LG_ret_owner(owner){ new str[MAX_PLAYER_NAME] = ""; if (owner == INVALID_PLAYER_ID) { str = "<none>"; } else { GetPlayerName(owner, str, sizeof (str)); } return str;}dcmd_buy(playerid, text[]){ #pragma unused text if (IsPlayerInCheckpoint(playerid)) { new point = gCurArea[playerid]; if (point != -1) { new cp = gLGPoints[point][MSPECIAL]; if ((cp & 0xFFFF) == LG_PROPERTY) { new price = gLGPoints[point][MOPTION_1]; if (GetPlayerMoney(playerid) >= price) { new string[256]; new owner = gLGPoints[point][MOWNER]; if (owner != INVALID_PLAYER_ID) { GetPlayerName(playerid, string, sizeof (string)); format(string, sizeof (string), "%s bought %s off you.", string, gLGPoints[point][MNAME]); SendClientMessage(owner, LG_MSG_COLOR, string); LGGivePlayerMoney(owner, price); GetPlayerName(owner, string, sizeof (string)); format(string, sizeof (string), " from %s ", string); } else { string = " "; } format(string, sizeof (string), "You purchased %s%sfor %d.", gLGPoints[point][MNAME], string, price); LGGivePlayerMoney(playerid, 0 - price); gLGPoints[point][MOWNER] = playerid; SendClientMessage(playerid, LG_MSG_COLOR, string); if (cp & LG_SELL) { gLGPoints[point][MSPECIAL] |= LG_NO_CHECKPOINT; format(string, sizeof (string), "Type \"/sell %d\" to sell it", point); SendClientMessage(playerid, LG_MSG_COLOR, string); } } else { SendClientMessage(playerid, LG_WRN_COLOR, "You do not have enough to purchase this property"); } return 1; } } } SendClientMessage(playerid, LG_WRN_COLOR, "You must be at a purchaseable property to use /buy"); return 1;}dcmd_sell(playerid, text[]){ if (LGIsNumeric(text)) { new num = strval(text); if (num >= 0 && num < sizeof (gLGPoints)) { if (gLGPoints[num][MOWNER] != playerid) { SendClientMessage(playerid, LG_WRN_COLOR, "You don't own this property"); } else { if (gLGPoints[num][MSPECIAL] & LG_SELL) { LGGivePlayerMoney(playerid, floatround(float(gLGPoints[num][MOPTION_1]) * 0.6)); SendClientMessage(playerid, LG_MSG_COLOR, "Property sold"); gLGPoints[num][MSPECIAL] &= LG_NO_CHECKPOINT ^ -1; gLGPoints[num][MOWNER] = INVALID_PLAYER_ID; } else { SendClientMessage(playerid, LG_WRN_COLOR, "You cannot sell this property"); } } } else { // Not a weapon SendClientMessage(playerid, LG_WRN_COLOR, "Invalid property"); } } else { // Not a number SendClientMessage(playerid, LG_WRN_COLOR, "Invalid property"); } return 1;}LGSpawn(playerid){ new j = gLGPlayerWep[playerid]; for (new i = 0; i < sizeof (gLGWepDat); i++) { if (j & (1 << i)) { GivePlayerWeapon(playerid, gLGWepDat[i][WWEAPON], gLGWepDat[i][WAMMO]); } }}dcmd_balance(playerid, text[]){ if (LGValidCP(playerid, LG_BANK)) { #pragma unused text new str[128]; format(str, sizeof (str), "Your current balance is %d", gLGBankBal[playerid]); SendClientMessage(playerid, LG_MSG_COLOR, str); } else { SendClientMessage(playerid, LG_MSG_COLOR, "You can't use that command here"); } return 1;}dcmd_bank(playerid, text[]){ if (LGValidCP(playerid, LG_BANK)) { new num = strval(text); if (num) { if (num > GetPlayerMoney(playerid)) { SendClientMessage(playerid, LG_WRN_COLOR, "Insufficient funds"); } else { gLGBankBal[playerid] += num; LGGivePlayerMoney(playerid, 0 - num); new str[128]; format(str, sizeof (str), "%d deposited, new balance: %d", num, gLGBankBal[playerid]); SendClientMessage(playerid, LG_MSG_COLOR, str); } } else { SendClientMessage(playerid, LG_WRN_COLOR, "You must enter a valid bank amount"); } } else { SendClientMessage(playerid, LG_MSG_COLOR, "You can't use that command here"); } return 1;}dcmd_withdraw(playerid, text[]){ if (LGValidCP(playerid, LG_BANK)) { new num = strval(text); if (num) { if (num > gLGBankBal[playerid]) { SendClientMessage(playerid, LG_WRN_COLOR, "Insufficient funds"); } else { gLGBankBal[playerid] -= num; LGGivePlayerMoney(playerid, num); new str[128]; format(str, sizeof (str), "%d withdrawn, new balance: %d", num, gLGBankBal); SendClientMessage(playerid, LG_MSG_COLOR, str); } } else { SendClientMessage(playerid, LG_WRN_COLOR, "You must enter a valid withdrawl amount"); } } else { SendClientMessage(playerid, LG_MSG_COLOR, "You can't use that command here"); } return 1;}LGCPCheck(playerid){ new point = gCurArea[playerid]; //GameTextForPlayer(playerid, gLGPoints[gCurArea[playerid]][NAME], 5000, 3); if (point >= 0 && point < sizeof (gLGPoints)) { new cp = gLGPoints[point][MSPECIAL]; switch (cp & 0xFFFF) { case LG_AMMU: { SendClientMessage(playerid, LG_MSG_COLOR, "Welcome to Ammunation!"); SendClientMessage(playerid, LG_MSG_COLOR, "Type /buyweapon [id] to buy a spawn weapon"); SendClientMessage(playerid, LG_MSG_COLOR, "Type /listweapons to list available weapons"); } case LG_BANK: { SendClientMessage(playerid, LG_MSG_COLOR, "Welcome to the bank!"); SendClientMessage(playerid, LG_MSG_COLOR, "Type /balance to display your balance, /bank"); SendClientMessage(playerid, LG_MSG_COLOR, "to bank money and /withdraw to withdraw"); } case LG_PROPERTY: { new string[256]; new owner = gLGPoints[point][MOWNER]; format(string, sizeof (string), "\"%s\". Current owner: %s", gLGPoints[point][MNAME], LG_ret_owner(owner)); SendClientMessage(playerid, LG_MSG_COLOR, string); SendClientMessage(playerid, LG_MSG_COLOR, "Type /buy to purchase this property"); format(string, sizeof (string), "Price: %d. Earnings: %d", gLGPoints[point][MOPTION_1], gLGPoints[point][MOPTION_2]); SendClientMessage(playerid, LG_MSG_COLOR, string); } case LG_TELEPORT: { new i; for (i = 0; i < LG_LINK_COUNT; i++) { if (gLGPoints[point][MLINKS][i] == -1) break; } if (gLGPoints[point][MOPTION_1]) { new string[256]; format(string, sizeof (string), "Cost: %d. Type \"/teleport x\" where x is", gLGPoints[point][MNAME]); SendClientMessage(playerid, LG_MSG_COLOR, string); SendClientMessage(playerid, LG_MSG_COLOR, "your required destination to teleport."); SendClientMessage(playerid, LG_MSG_COLOR, "Type \"/listdest\" for a list of destinations"); } else { if (i == 1) { new j = gLGPoints[point][MLINKS][0]; SetPlayerInterior(playerid, gLGPoints[j][MOPTION_1]); SetPlayerPos(playerid, gLGPoints[j][MCP_X], gLGPoints[j][MCP_Y], gLGPoints[j][MCP_Z]); SetPlayerFacingAngle(playerid, gLGPoints[j][MCP_S]); } else if (i) { SendClientMessage(playerid, LG_MSG_COLOR, "Type \"/teleport x\" where x is"); SendClientMessage(playerid, LG_MSG_COLOR, "your required destination to teleport."); SendClientMessage(playerid, LG_MSG_COLOR, "Type \"/listdest\" for a list of destinations"); } } } case LG_SPECIAL_POINT: { #if defined LG_SPECIAL_POINT_CODE LG_SPECIAL_POINT_CODE(playerid, point); #else print("Warning: LG_SPECIAL_POINT_CODE not found"); #endif } } return 1; } return 0;}LGParseCmd(playerid, cmdtext[]){ #pragma unused LGParseCmd dcmd2(bank, 4); dcmd2(withdraw, 8); dcmd2(balance, 7); dcmd2(buy, 3); dcmd2(sell, 4); dcmd2(buyweapon, 9); dcmd2(teleport, 8); if ((strcmp(cmdtext, "/listdest", true, 9) == 0) && dcmd_listdest(playerid, cmdtext[9])) return 1; if ((strcmp(cmdtext, "/properties", true, 11) == 0) && dcmd_properties(playerid, cmdtext[11])) return 1; if ((strcmp(cmdtext, "/listweapons", true, 12) == 0) && dcmd_listweapons(playerid, cmdtext[12])) return 1; return 0;}LGIsNumeric(const string[]){ if ((string[0] > '9' || string[0] < '0') && (string[0] != '-')) return 0; for (new i = 1, j = strlen(string); i < j; i++) { if (string[i] > '9' || string[i] < '0') return 0; } return 1;}