13.09.2011, 18:54
pawn Код:
CMD:setfactionent(playerid, params[])
{
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
if(AdminLevel[playerid] < 4) return SendClientMessage(playerid, COLOUR_GREY, "You are not authorized to use this command.");
if(isnull(params)) return SendClientMessage(playerid, COLOUR_GREY, "Usage: /setfactionent [factionid]");
new factionid = strval(params);
new id = MySQL_GetValue(FactionSQLID[id], "id", "factions");
new Float: x, Float: y, Float: z;
GetPlayerPos(playerid, x, y, z);
FactionEntX[factionid] = x;
FactionEntY[factionid] = y;
FactionEntZ[factionid] = z;
CreateDynamicPickup(1318, 23, FactionEntX[factionid], FactionEntY[factionid], FactionEntZ[factionid], 0, -1, -1, 100);
MySQL_SetFloat(FactionSQLID[factionid], "FactionEntX", x, "factions");
MySQL_SetFloat(FactionSQLID[factionid], "FactionEntY", y, "factions");
MySQL_SetFloat(FactionSQLID[factionid], "FactionEntZ", z, "factions");
new string[128];
format(string, sizeof(string), "You have set %s's entrance", FactionName[factionid]);
SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
return 1;
}
Thanks in advance.