03.05.2011, 19:08
pawn Код:
if(strcmp(cmd, "/entregarpreso", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pEmprego] == 15 || gTeam[playerid] == 2 || PlayerInfo[playerid][pLider] == 6 || PlayerInfo[playerid][pLider] == 10)
{
if(gTeam[playerid] == 2 || IsACop(playerid) || IsACopSF(playerid)|| IsAPF(playerid))
{
if(!PlayerToPoint(8.0,playerid,96.9123,1920.5088,18.1473))
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo estб no Portгo de Entrega da Бrea 51 !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USE: /entregarpreso [ id ]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, " Nгo pode colocar vocк mesmo no Fort DeMorgan !"); return 1; }
if(PlayerInfo[giveplayerid][pProcurado2] < 1) { SendClientMessage(playerid, COLOR_GREY, " O Jogador precisa de ao menos nнvel 1 de Procurado para ser entregado no Fort DeMorgan !"); return 1; }
if(gTeam[giveplayerid] == 2 || PlayerInfo[giveplayerid][pLider] == 6 || PlayerInfo[giveplayerid][pLider] == 10) { return 1; }
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Vocк entregou %s para o Fort DeMorgan", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s entregou vocк para o Fort DeMorgan.", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
GameTextForPlayer(giveplayerid, "~w~Bem Vindo ao ~n~~r~Fort DeMorgan", 5000, 3);
PlayerInfo[giveplayerid][pProcurado1] = 0;
OnPlayerUpdate(giveplayerid);
PlayerInfo[giveplayerid][pProcurado2] = 0;
PlayerInfo[giveplayerid][pJailed] = 2;
PlayerInfo[giveplayerid][pJailTime] = 3600;
SetPlayerPos(giveplayerid, 107.2300,1920.6311,18.5208);
SetPlayerWorldBounds(giveplayerid, 337.5694,101.5826,1940.9759,1798.7453); //285.3481,96.9720,1940.9755,1799.0811
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador esta longe de voce !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador Esta Offline !");
return 1;
}
}
else if(PlayerInfo[playerid][pEmprego] == 15)
{
if(BringingPaper[playerid] != 1)
{
SendClientMessage(playerid, COLOR_GREY, " You haven't picked up a Newspaper from the News SBTs Building yet !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USE: /deliver [ id ]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* You offerd one of Your Newspapers to %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Jornaleiro %s ofereceu jornal a voce (use /aceitar jornal, para aceitar).", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PaperOffer[giveplayerid] = playerid;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador esta longe de voce !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador Esta Offline !");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Voce nao e jornaleiro !");
return 1;
}
}
return 1;
}
if(strcmp(cmd, "/pegarjornais", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pEmprego] != 15)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й entrador de jornal.. !");
return 1;
}
if(PlayerToPoint(3.0,playerid,648.6782,-1357.4170,13.5698))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USE: /pegarjornais [papernr]");
return 1;
}
new paper = strval(tmp);
if(paper < 1 || paper > 10) { SendClientMessage(playerid, COLOR_GREY, " Jornal de 1 a 10 !"); return 1; }
paper -= 1;
if(PaperInfo[paper][PaperUsed] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Nгo tem esse nъmero de jornal !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* Vocк tem jornal novos, Jornal: %s, By: %s.",PaperInfo[paper][PaperTitle],PaperInfo[paper][PaperMaker]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "%s", PaperInfo[paper][PaperTitle]);
strmid(Paper[playerid][pTitle], string, 0, strlen(string), 255);
format(string, sizeof(string), "%s", PaperInfo[paper][PaperMaker]);
strmid(Paper[playerid][pMaker], string, 0, strlen(string), 255);
format(string, sizeof(string), "%s", PaperInfo[paper][PaperText1]);
strmid(Paper[playerid][pLine1], string, 0, strlen(string), 255);
format(string, sizeof(string), "%s", PaperInfo[paper][PaperText2]);
strmid(Paper[playerid][pLine2], string, 0, strlen(string), 255);
format(string, sizeof(string), "%s", PaperInfo[paper][PaperText3]);
strmid(Paper[playerid][pLine3], string, 0, strlen(string), 255);
format(string, sizeof(string), "%s", PaperInfo[paper][PaperText4]);
strmid(Paper[playerid][pLine4], string, 0, strlen(string), 255);
format(string, sizeof(string), "%s", PaperInfo[paper][PaperText5]);
strmid(Paper[playerid][pLine5], string, 0, strlen(string), 255);
format(string, sizeof(string), "%s", PaperInfo[paper][PaperText6]);
strmid(Paper[playerid][pLine6], string, 0, strlen(string), 255);
format(string, sizeof(string), "%s", PaperInfo[paper][PaperText7]);
strmid(Paper[playerid][pLine7], string, 0, strlen(string), 255);
BringingPaper[playerid] = 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo estб nos SBT !");
return 1;
}
}
return 1;
}