10.07.2010, 17:55
(
Последний раз редактировалось felipe360; 10.07.2010 в 18:31.
)
Bom fiz um ranking de sub 555 e 444 no /convidar fica assim ou tem geito mais facil de fazer?
Nesta parte:
Tem geito de se fazer em apenas uma linha?
Код:
if(strcmp(cmd, "/convidar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /convidar [ id ]");
return 1;
}
new para1;
new ftext[20];
para1 = ReturnUser(tmp);
if (PlayerInfo[playerid][pLider] >= 1)
{
if(IsPlayerConnected(para1))
{
if(PlayerInfo[para1][pNivel] < 1) { SendClientMessage(playerid, COLOR_GREY, "So pode convidar quem й nivel 1 ou acima de 1!!!"); return 1;
}
if(para1 != INVALID_PLAYER_ID)
{
if (PlayerInfo[para1][pMembro] == 0 && PlayerInfo[para1][pFMember] == 255)
{
if(PlayerInfo[playerid][pLider] == 1) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "Policia Militar LS"; ChosenSkin[para1] = 282; SetPlayerSkin(para1, 282); }
else if(PlayerInfo[playerid][pCargo] == 444) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "Policia Militar LS"; ChosenSkin[para1] = 282; SetPlayerSkin(para1, 282); }
else if(PlayerInfo[playerid][pCargo] == 555) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "Policia Militar LS"; ChosenSkin[para1] = 282; SetPlayerSkin(para1, 282); }
else { return 1; }
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pMembro] = PlayerInfo[playerid][pLider];
PlayerInfo[para1][pCargo] = 1;
printf("(AdminCmd) - %s convidou %s para entrar %s.", sendername, giveplayer, ftext);
format(string, sizeof(string), "Voce foi convidado para a %s, pelo Lнder %s", ftext, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Voce convidou %s para a %s.", giveplayer,ftext);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
SetPlayerInterior(para1,0);
PlayerInfo[playerid][pCarLic] = 1;
PlayerInfo[playerid][pFlyLic] = 1;
PlayerInfo[playerid][pBoatLic] = 1;
PlayerInfo[playerid][pFishLic] = 1;
PlayerInfo[playerid][pGunLic] = 1;
new rand = random(sizeof(gInviteSpawns));
SetPlayerPos(para1, gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]); // Warp the player
SetPlayerFacingAngle(para1, gInviteSpawns[rand][3]);
SetPlayerCameraPos(para1,gInviteSpawns[rand][0] + 3, gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
SetPlayerCameraLookAt(para1,gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
TogglePlayerControllable(para1, 0);
SelectChar[para1] = 255;
SelectCharID[para1] = PlayerInfo[para1][pMembro];
SelectCharPlace[para1] = 1;
PlayerInfo[para1][pModel] = ChosenSkin[para1];
PlayerInfo[para1][pChar] = ChosenSkin[para1];
SendClientMessage(para1, COLOR_LIGHTRED, "* Use 'Proximo' para trocar a skin.");
SendClientMessage(para1, COLOR_LIGHTRED, "* Quando voce achar a Skin preferida, Digite 'Confirma'.");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Este player ou e Procura / Tem Emprego ou / Familia");
return 1;
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Voce nao esta autorizado para usar este cmd ( Apenas Lideres )!");
}
}
return 1;
}
Код:
if(PlayerInfo[playerid][pLider] == 1) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "Policia Militar LS"; ChosenSkin[para1] = 282; SetPlayerSkin(para1, 282); }
else if(PlayerInfo[playerid][pCargo] == 444) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "Policia Militar LS"; ChosenSkin[para1] = 282; SetPlayerSkin(para1, 282); }
else if(PlayerInfo[playerid][pCargo] == 555) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "Policia Militar LS"; ChosenSkin[para1] = 282; SetPlayerSkin(para1, 282); }


