25.04.2015, 22:41
pawn Код:
zcmd(asignar, playerid, params[])
{
new string[128], suffix[10], lookupid, factionid;
if(sscanf(params, "s[10]ii", suffix, lookupid, factionid)) return SendClientMessage(playerid, COLOR_WHITE, "Info: Uso correcto: /Asignar faccion [ID Jugador] [ID Facciуn]");
if(strcmp(suffix, "faccion", true) == 0)
{
if(Info[playerid][pAdminZC] > 1337)
{
new ftext[30];
if(factionid < 0 || factionid > MAX_FACTION) return SendClientMessageEx(playerid, COLOR_GREY, "ID facciуn incorrecto.");
if(!IsPlayerConnected(lookupid)) return SendClientMessageEx(playerid, COLOR_GREY, "Jugado desconectado.");
switch(factionid)
{
case 0: {Info[lookupid][pRank] = 0; ftext = "Ninguna"; }
case 1: {Info[lookupid][pRank] = 6; ftext = "San Andreas Police Department"; }
case 2: {Info[lookupid][pRank] = 6; ftext = "FBI"; }
case 3: {Info[lookupid][pRank] = 6; ftext = "San Andreas Ejйrcito Militar"; }
case 4: {Info[lookupid][pRank] = 6; ftext = "San Andreas Medical Deparment"; }
case 5: {Info[lookupid][pRank] = 6; ftext = "SA News"; }
case 6: {Info[lookupid][pRank] = 6; ftext = "Taller de mecбnicos LS"; }
case 7: {Info[lookupid][pRank] = 6; ftext = "Gobierno"; }
case 8: {Info[lookupid][pRank] = 6; ftext = "Hitman"; }
case 9: {Info[lookupid][pRank] = 6; ftext = "Sistema Judicial"; }
}
pTazer[lookupid] = 0;
Info[lookupid][pLeader] = factionid;
Info[lookupid][pMember] = factionid;
format(string, sizeof(string), "* El administrador %s te asignу el lнder de la facciуn %s.", GetPlayerNameEx(playerid), ftext);
SendClientMessageEx(lookupid, 0x6ADFFFFF, string);
format(string, sizeof(string), "Administraciуn: %s asignу lнder de la facciуn %s a %s.", GetPlayerNameEx(playerid), ftext, GetPlayerNameEx(lookupid));
ABroadCast(COLOR_WHITE, string, 3);
}
else return SendClientMessageEx(playerid, COLOR_WHITE, "Informaciуn: No puedes utilizar йste comando.");
}
else return SendClientMessage(playerid, COLOR_WHITE, "Info: Uso correcto: /Asignar faccion [ID Jugador] [ID Facciуn]");
return 1;
}