[Pedido] 'PegarContrato"
#1

Olб pessoal, como que eu mudo para o jogador nгo precisar digitar o ID dele, pois ele tem que digitar "PegarContrato 15", gostaria de que ele sу tivesse que digitar "PegarContrato" e o contrato jб fosse para ele, resolvi voltar com SA:MP =D.
pawn Код:
else if ((strcmp("PegarContrato", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("PegarContrato")))
        {
            if(PlayerInfo[playerid][pCargo] < 1)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й um Hitman/Triad");
                return 0;
            }
            if(hitfound == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Nгo ha contratos, USE contratos em seu laptop primeiro!");
                return 0;
            }
            tmp = strtok(text, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "USE: PegarContrato [Seu ID]");
                return 0;
            }
            giveplayerid = ReturnUser(tmp);
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    if(GetPlayerOrg(playerid) != GetPlayerOrg(giveplayerid))
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   Esse Jogador nгo й um Assassino!");
                        return 0;
                    }
                    if(GoChase[giveplayerid] < 999)
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   Vocк jб tem um contrato!");
                        return 0;
                    }
                    if(IsPlayerConnected(hitid))
                    {
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        GetPlayerName(giveplayerid, giver, sizeof(giver));
                        GetPlayerName(hitid, giveplayer, sizeof(giveplayer));
                        format(string, sizeof(string), "* Assasino %s pegou o contrato em %s [ID: %d], por R$%d.", sendername, giveplayer, hitid, PlayerInfo[hitid][pHeadValue]);
                        SendFamilyMessage(GetPlayerOrg(playerid), COLOR_YELLOW, string);
                        GoChase[giveplayerid] = hitid;
                        GetChased[hitid] = giveplayerid;
                        GotHit[hitid] = 1;
                        hitid = 0;
                        hitfound = 0;
                        return 0;
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   O contrato saiu do servidor, Use contratos no seu laptop novamente!");
                        return 0;
                    }
                }
                return 0;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   Esse nгo й seu ID!");
                return 0;
            }
        }
Reply
#2

@up!
Reply
#3

Tenta tirar isto

pawn Код:
tmp = strtok(text, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "USE: PegarContrato [Seu ID]");
                return 0;
            }

@OFF Amo Jujuba.
Reply
#4

pawn Код:
else if ((strcmp("PegarContrato", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("PegarContrato")))
        {
            if(PlayerInfo[playerid][pCargo] < 1)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й um Hitman/Triad");
                return 0;
            }
            if(hitfound == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Nгo ha contratos, USE contratos em seu laptop primeiro!");
                return 0;
            }
            if(IsPlayerConnected(giveplayerid))
            {
                    if(GoChase[playerid] < 999)
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   Vocк jб tem um contrato!");
                        return 0;
                    }
                    if(IsPlayerConnected(hitid))
                    {
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        GetPlayerName(giveplayerid, giver, sizeof(giver));
                        GetPlayerName(hitid, giveplayer, sizeof(giveplayer));
                        format(string, sizeof(string), "* Assasino %s pegou o contrato em %s [ID: %d], por R$%d.", sendername, giveplayer, hitid, PlayerInfo[hitid][pHeadValue]);
                        SendFamilyMessage(GetPlayerOrg(playerid), COLOR_YELLOW, string);
                        GoChase[playerid] = hitid;
                        GetChased[hitid] = playerid;
                        GotHit[hitid] = 1;
                        hitid = 0;
                        hitfound = 0;
                        return 0;
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   O contrato saiu do servidor, Use contratos no seu laptop novamente!");
                        return 0;
                    }
            }
        }
prnt
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)