Jump to content

Cerere Script


iluzzyon

Recommended Posts

Nume: iluZZyon

Nume tutorial: /attack cu un anumit interval

Descriere: Cum pot face comanda /attack sa poata ataca doar intre orele 21 - 22

[pawn]CMD:attack(playerid, params[])

{

if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");

new hour,minn,sec;

gettime(hour,minn,sec);

if(!IsAMember(playerid)) return SCM(playerid,COLOR_WHITE,"{FFB870}Error: You are not a member of the Mafia.");

if(PlayerInfo[playerid][pRank] < 3) return SCM(playerid,TEAM_AZTECAS_COLOR,"Error: You do not have rank 3.");

new turf,faction,string[100],sendername[MAX_PLAYER_NAME];

for(new i = 1; i <= sizeof(TurfInfo); i++)

{

if(IsPlayerInTurf(playerid, i) == 1)

{

turf = i;

break;

}

    }

    GetPlayerName(playerid, sendername, sizeof(sendername));

    if(turf == 0) return SCM(playerid, TEAM_AZTECAS_COLOR, "Error: You are not on a territory.");

    faction = PlayerInfo[playerid][pMember];

    if(TurfInfo[turf][zOwned] == faction) return SCM(playerid, TEAM_AZTECAS_COLOR, "Error: You can't attack your own turf.");

if(WarInfo[turf][wAttacker] != 0) return SCM(playerid, TEAM_AZTECAS_COLOR, "Error: Turf is already attacked.");

if(TurfInfo[turf][zTime] > 0)

{

format(string,sizeof(string),"Error: Turf can be attacked in %d hours.",TurfInfo[turf][zTime]);

SCM(playerid, TEAM_AZTECAS_COLOR,string);

return 1;

}

if(InWar[faction] == 1) return SCM(playerid, TEAM_AZTECAS_COLOR, "Error: You have an active war.");

if(InWar[TurfInfo[turf][zOwned]] == 1) return SCM(playerid, TEAM_AZTECAS_COLOR, "Error: This mafia have active war.");

TurfInfo[turf][zTime] = 24;

new str[128];

format(str,128,"UPDATE `turfs` SET `Time`='24' WHERE `ID`='%d'",turf);

mysql_query(SQL,str);

WarInfo[turf][wTime] = 900;

WarInfo[turf][wAttacker] = faction;

WarInfo[turf][wFaction] = TurfInfo[turf][zOwned];

format(string,sizeof(string),"Your mafia (%s) attacked turf %d owned by %s",sendername,turf,NumeFactiune(TurfInfo[turf][zOwned]));

SendFamilyMessage(faction,TEAM_AZTECAS_COLOR,string);

format(string,sizeof(string),"Turf %d, Time remaining: %s",turf,CalculeazaTimp(WarInfo[turf][wTime]));

SendFamilyMessage(faction,TEAM_AZTECAS_COLOR,string);

format(string,sizeof(string),"%s (%s) attacked your turf %d",NumeFactiune(WarInfo[turf][wAttacker]),sendername,turf);

SendFamilyMessage(TurfInfo[turf][zOwned],TEAM_AZTECAS_COLOR,string);

format(string,sizeof(string),"Turf %d, Time remaining: %s",turf,CalculeazaTimp(WarInfo[turf][wTime]));

SendFamilyMessage(TurfInfo[turf][zOwned],TEAM_AZTECAS_COLOR,string);

worstscoreat[turf] = 0;

worstmemberat[turf] = 999;

bestscoreat[turf] = 0;

bestmemberat[turf] = 999;

worstscoredf[turf] = 0;

worstmemberdf[turf] = 999;

bestscoredf[turf] = 0;

bestmemberdf[turf] = 999;

InWar[TurfInfo[turf][zOwned]] = 1;

InWar[faction] = 1;

return 1;

}[/pawn]

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.