[AJUDA] Nгo spawnaa ajuda plz
#1

Seguinte, eu entro no servidor, as vezes spawna (se o player й sem org spawna pra onde comeзa, se o player й de uma org spawna pra HQ) o problema й que as vezes nгo spawna, tu faz o login la no dialog e n spawna(fica na tela de login ainda) e no game quando morre de vez de ir para o hospital vai para tela de login, alguйm pode me dizer por que isso acontece? agradeзo desde jб
Reply
#2

Como nгo mandou cуdigo nenhum, analise o cуdigo e veja se nгo falta isto:
pawn Код:
SetPlayerSpawn(playerid);
Reply
#3

Olha nas public OnPlayerSpawn e OnPlayerDeath, olha tambem no sistema de login. As veses tem algum codigo errado.
Reply
#4



pois й, deve ter sim, ou serб por causa dessa waring, olhem:
pawn Код:
C:\Documents and Settings\.Marcelo\Desktop\BMG v2.0c\pawno\include\P-STREAMER\PSO\1.0#PSO_LIB\#PSO_ESTRUTURA\PSO_F.FFR(17) : warning 201: redefinition of constant/macro (symbol "SetPlayerPos")
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warnings.
Reply
#5

Use esta funзгo para spawnar o player:

pawn Код:
SpawnPlayer(playerid);
Adapte ela no OnPlayerLogin/OnPlayerRegister ou onde estiver "bugando" na tela de espera do Spawn.


Se quiser resolver este warning, poste aqui no tуpico as suas linhas que tiverem #include, que normalmente ficam no topo do GM.


Espero ter ajudado
Reply
#6

as includes:

pawn Код:
#include <a_samp>
#include <BmG_Objects>
#include <PBP>
#include <dini>
#include <utils>
#include <morphinc>
#include <properties>
#include <core>
#include <float>
#include <time>
#include <file>
o que tem de errado ai pra dar waring?

eu vi em onplayerlogin, onplayerspawn ta tudo certinho, quando loga as vezes spawna automaticamente, mais as vezes n sai da tela de login, ja qdo morre vai pra tela de login.
Reply
#7

Substitua as linhas das includes que vocк postou pelas citadas abaixo, isto deve resolver o seu warning:

pawn Код:
#include <a_samp>
#undef SetPlayerPos
#include <BmG_Objects>
#include <PBP>
#include <dini>
#include <utils>
#include <morphinc>
#include <properties>
#include <core>
#include <float>
#include <time>
#include <file>

Espero ter ajudado
Reply
#8

erro na linha 2:
pawn Код:
C:\Documents and Settings\.Marcelo\Desktop\BMG v2.0c\gamemodes\BMG.pwn(2) : error 017: undefined symbol "SetPlayerPos"
C:\Documents and Settings\.Marcelo\Desktop\BMG v2.0c\gamemodes\BMG.pwn(2) : error 010: invalid function or declaration
linha 2:
pawn Код:
#undef SetPlayerPos
deixa isso pra lб, o que eu quero saber mesmo й por que nгo spawna
Reply
#9

Fica dificil se vc nao postar todo o cуdigo do seu login, do dialog response...
Reply
#10

public OnPlayerLogin:
pawn Код:
public OnPlayerLogin(playerid,password[])
{
    new tmp2[256];
    new string2[64];
    new playername2[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername2, sizeof(playername2));
    format(string2, sizeof(string2), "Contas/%s.---", playername2);
    new File: UserFile = fopen(string2, io_read);
    if ( UserFile )
    {
        new PassData[256];
        new keytmp[256], valtmp[256];
        fread( UserFile , PassData , sizeof( PassData ) );
        keytmp = ini_GetKey( PassData );
        if( strcmp( keytmp , "Key" , true ) == 0 )
        {
            valtmp = ini_GetValue( PassData );
            strmid(PlayerInfo[playerid][pKey], valtmp, 0, strlen(valtmp)-1, 255);
        }
        if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0 )
        {
                new key[ 256 ] , val[ 256 ];
                new Data[ 256 ];
                while ( fread( UserFile , Data , sizeof( Data ) ) )
                {
                    key = ini_GetKey( Data );
                    if( strcmp( key , "Level" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLevel] = strval( val ); }
                    if( strcmp( key , "AdminLevel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAdmin] = strval( val ); }
                    if( strcmp( key , "SocioLevel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSocio] = strval( val ); }
                    if( strcmp( key , "DonateRank" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pVIP] = strval( val ); }
                    if( strcmp( key , "UpgradePoints" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][gPupgrade] = strval( val ); }
                    if( strcmp( key , "ConnectedTime" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pConnectTime] = strval( val ); }
                    if( strcmp( key , "Registered" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pReg] = strval( val ); }
                    if( strcmp( key , "Sex" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSex] = strval( val ); }
                    if( strcmp( key , "Familia" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pFamily] = strval( val ); }
                    if( strcmp( key , "origin" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pOrigem] = strval( val ); }
                    if( strcmp( key , "CK" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCK] = strval( val ); }
                    if( strcmp( key , "Muted" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMuted] = strval( val ); }
                    if( strcmp( key , "Respect" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pExp] = strval( val ); }
                    if( strcmp( key , "Money" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCash] = strval( val ); }
                    if( strcmp( key , "Bank" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pConta] = strval( val ); }
                    if( strcmp( key , "Crimes" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCrimes] = strval( val ); }
                    if( strcmp( key , "Kills" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pKills] = strval( val ); }
                    if( strcmp( key , "Deaths" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDeaths] = strval( val ); }
                    if( strcmp( key , "Arrested" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pArrested] = strval( val ); }
                    if( strcmp( key , "WantedDeaths" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pWantedDeaths] = strval( val ); }
                    if( strcmp( key , "Phonebook" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPhoneBook] = strval( val ); }
                    if( strcmp( key , "LottoNr" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLottoNr] = strval( val ); }
                    if( strcmp( key , "Fishes" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pFishes] = strval( val ); }
                    if( strcmp( key , "BiggestFish" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pBiggestFish] = strval( val ); }
                    if( strcmp( key , "Emprego" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pEmprego] = strval( val ); }
                    if( strcmp( key , "Paycheck" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPayCheck] = strval( val ); }
                    if( strcmp( key , "HeadValue" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pHeadValue] = strval( val ); }
                    if( strcmp( key , "Jailed" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pJailed] = strval( val ); }
                    if( strcmp( key , "JailTime" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pJailTime] = strval( val ); }
                    if( strcmp( key , "Materiais" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMats] = strval( val ); }
                    if( strcmp( key , "Maconha" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDrogas] = strval( val ); }
                    if( strcmp( key , "Cocaina" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDrogas2] = strval( val ); }
                    if( strcmp( key , "Crack" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDrogas3] = strval( val ); }
                    if( strcmp( key , "Balinha" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pBalinha] = strval( val ); }
                    if( strcmp( key , "Lider" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLider] = strval( val ); }
                    if( strcmp( key , "Member" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMembro] = strval( val ); }
                    if( strcmp( key , "FMember" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pFMember] = strval( val ); }
                    if( strcmp( key , "Rank" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCargo] = strval( val ); }
                    if( strcmp( key , "Char" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pChar] = strval( val ); }
                    if( strcmp( key , "ContractTime" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pContractTime] = strval( val ); }
                    if( strcmp( key , "DetSkill" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDetSkill] = strval( val ); }
                    if( strcmp( key , "SexSkill" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSexSkill] = strval( val ); }
                    if( strcmp( key , "BoxSkill" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pBoxSkill] = strval( val ); }
                    if( strcmp( key , "LawSkill" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLawSkill] = strval( val ); }
                    if( strcmp( key , "MechSkill" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMechSkill] = strval( val ); }
                    if( strcmp( key , "JackSkill" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pJackSkill] = strval( val ); }
                    if( strcmp( key , "CarSkill" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCarSkill] = strval( val ); }
                    if( strcmp( key , "NewsSkill" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pNewsSkill] = strval( val ); }
                    if( strcmp( key , "DrogasSkill" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDrogasSkill] = strval( val ); }
                    if( strcmp( key , "BalinhaSkill" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pBalinhaSkill] = strval( val ); }
                    if( strcmp( key , "CookSkill" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCookSkill] = strval( val ); }
                    if( strcmp( key , "FishSkill" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pFishSkill] = strval( val ); }
                    if( strcmp( key , "pSHealth" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSHealth] = floatstr( val ); }
                    if( strcmp( key , "pHealth" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pHealth] = floatstr( val ); }
                    if( strcmp( key , "Int" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pInt] = strval( val ); }
                    if( strcmp( key , "Local" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLocal] = strval( val ); }
                    if( strcmp( key , "Team" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pTeam] = strval( val ); }
                    if( strcmp( key , "Model" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pModel] = strval( val ); }
                    if( strcmp( key , "PhoneNr" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPnumber] = strval( val ); }
                    if( strcmp( key , "House" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPHousekey] = strval( val ); }
                    if( strcmp( key , "Bizz" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPbiskey] = strval( val ); }
                    if( strcmp( key , "Pos_x" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPos_x] = floatstr( val ); }
                    if( strcmp( key , "Pos_y" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPos_y] = floatstr( val ); }
                    if( strcmp( key , "Pos_z" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPos_z] = floatstr( val ); }
                    if( strcmp( key , "CarLic" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCarLic] = strval( val ); }
                    if( strcmp( key , "FlyLic" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pFlyLic] = strval( val ); }
                    if( strcmp( key , "BoatLic" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pBoatLic] = strval( val ); }
                    if( strcmp( key , "FishLic" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pFishLic] = strval( val ); }
                    if( strcmp( key , "GunLic" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pGunLic] = strval( val ); }
                    if( strcmp( key , "Gun1" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pGun1] = strval( val ); }
                    if( strcmp( key , "Gun2" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pGun2] = strval( val ); }
                    if( strcmp( key , "Gun3" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pGun3] = strval( val ); }
                    if( strcmp( key , "Gun4" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pGun4] = strval( val ); }
                    if( strcmp( key , "Ammo1" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAmmo1] = strval( val ); }
                    if( strcmp( key , "Ammo2" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAmmo2] = strval( val ); }
                    if( strcmp( key , "Ammo3" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAmmo3] = strval( val ); }
                    if( strcmp( key , "Ammo4" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAmmo4] = strval( val ); }
                    if( strcmp( key , "CarTime" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCarTime] = strval( val ); }
                    if( strcmp( key , "PayDay" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPayDay] = strval( val ); }
                    if( strcmp( key , "PayDayHad" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPayDayHad] = strval( val ); }
                    if( strcmp( key , "CDPlayer" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCDPlayer] = strval( val ); }
                    if( strcmp( key , "Wins" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pWins] = strval( val ); }
                    if( strcmp( key , "Loses" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLoses] = strval( val ); }
                    if( strcmp( key , "AlcoholPerk" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAlcoholPerk] = strval( val ); }
                    if( strcmp( key , "DrugPerk" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDrugPerk] = strval( val ); }
                    if( strcmp( key , "MiserPerk" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMiserPerk] = strval( val ); }
                    if( strcmp( key , "PainPerk" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPainPerk] = strval( val ); }
                    if( strcmp( key , "TraderPerk" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pTraderPerk] = strval( val ); }
                    if( strcmp( key , "Tutorial" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pTut] = strval( val ); }
                    if( strcmp( key , "Mission" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMissionNr] = strval( val ); }
                    if( strcmp( key , "Avisos" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pWarns] = strval( val ); }
                    if( strcmp( key , "Adjustable" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAdjustable] = strval( val ); }
                    if( strcmp( key , "Fuel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pFuel] = strval( val ); }
                    if( strcmp( key , "Married" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMarried] = strval( val ); }
                    if( strcmp( key , "MarriedTo" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayerInfo[playerid][pMarriedTo], val, 0, strlen(val)-1, 255); }
                    //if( strcmp( key , "Spawn" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSpawn] = strval( val ); }
                    if( strcmp( key , "Ban" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pBan] = strval( val ); }
                    if( strcmp( key , "SafeMaconha" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSafeDrogas] = strval( val ); }
                    if( strcmp( key , "SafeCocaina" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSafeDrogas2] = strval( val ); }
                    if( strcmp( key , "SafeCrack" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSafeDrogas3] = strval( val ); }
                    if( strcmp( key , "GPS" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pGPS] = strval( val ); }
                    if( strcmp( key , "NivelProcurado" , true ) == 0 ) { val = ini_GetValue( Data ); WantedPoints[playerid] = strval( val ); }
                    if( strcmp( key , "SafeMateriais" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][psMats] = strval( val ); }
                    PlayerCarregarBan(playerid);
                    CheckOwner(playerid);
                    //CheckAdmin(playerid);
                    CheckOwnerb(playerid);
                    CheckOwnerh(playerid);
                    //CheckVip(playerid);
                }
                fclose(UserFile);
        }
        else
        {
            new loginstring[450];
            new loginname[MAX_PLAYER_NAME];
            GetPlayerName(playerid,loginname,sizeof(loginname));
            format(loginstring,sizeof(loginstring),"Senha Errada\nInforme a senha correta:",loginname);
            ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Logar",loginstring,"Logar","Sair");
            fclose(UserFile);
            gPlayerLogTries[playerid] += 1;
            if(gPlayerLogTries[playerid] == 10) { Ban(playerid); }
            return 1;
        }
        PlayerInfo[playerid][pAdjustable] = 0;
        ResetPlayerMoneyEx(playerid);
        ConsumingMoney[playerid] = 1;
        GivePlayerMoneyEx(playerid,PlayerInfo[playerid][pCash]);
        CurrentMoney[playerid] = PlayerInfo[playerid][pCash];
        if(PlayerInfo[playerid][pReg] == 0)
        {
            PlayerInfo[playerid][pLevel] = 2;
            PlayerInfo[playerid][pSHealth] = 0.0;
            PlayerInfo[playerid][pHealth] = 100.0;
            PlayerInfo[playerid][pPos_x] = 2246.6;
            PlayerInfo[playerid][pPos_y] = -1161.9;
            PlayerInfo[playerid][pPos_z] = 1029.7;
            PlayerInfo[playerid][pInt] = 15;
            PlayerInfo[playerid][pLocal] = 255;
            PlayerInfo[playerid][pTeam] = 3;
            PlayerInfo[playerid][pModel] = 137;
            new randphone = 1000 + random(8999);//
            PlayerInfo[playerid][pPnumber] = randphone;
            PlayerInfo[playerid][pPHousekey] = 255;
            PlayerInfo[playerid][pPbiskey] = 255;
            PlayerInfo[playerid][pConta] = 100;
            PlayerInfo[playerid][pReg] = 1;
            PlayerInfo[playerid][pEmprego] = 18;
            ResetPlayerMoneyEx(playerid);
        }
        if(PlayerInfo[playerid][pBan] == 2) //autoban
        {
            new giveplayer[MAX_PLAYER_NAME];
            new playersip[256];
            new string[256];
            GetPlayerName(playerid, giveplayer, sizeof(giveplayer));
            GetPlayerIp(playerid,playersip,sizeof(playersip));
            format(string,sizeof(string),"Esta Conta estб banido deste servidor\n\nInformaзхes do banimento\n\n****************************\n\nConta:%s \nIP:%d \nAdmin:%s \nMotivo:%s \n\nSe Vocк acha que isto й um erro, vб atй o nosso forum\n\n***************www.brasilmatrixforuns.forumeiros.net***************",giveplayer,playersip,PoderosoInfo[playerid][pAdmBan],PoderosoInfo[playerid][pMotivo]);
            ShowPlayerDialog(playerid,9999,DIALOG_STYLE_MSGBOX,"Conta Banido Deste Servidor", string, "OK","Cancelar");
            //SBan(playerid);
            Kick(playerid);
        }
        if(PlayerInfo[playerid][pLevel] == -999) //autoban
        {
            SBan(playerid);
        }
        if(PlayerInfo[playerid][pAdmin] >= 5010)//autoban
        {
            SBan(playerid);
        }
        else if(PlayerInfo[playerid][pCK] > 0)
        {
            Kick(playerid);
        }
        SendClientMessage(playerid, COLOR_YELLOW,   "=============================================");
        SendClientMessage(playerid, COLOR_WHITE,    "Dono: ---------------");
        SendClientMessage(playerid, COLOR_WHITE,    "Scripter: -------------");
        SendClientMessage(playerid, COLOR_WHITE,    "Map Scripter: --------------");
        SendClientMessage(playerid, COLOR_WHITE,    "ADM responsбvel: ----------------");
        SendClientMessage(playerid, COLOR_WHITE,    "Fуrum: ---------------------");
        SendClientMessage(playerid, COLOR_WHITE,    "Suporte : --------------------");
        SendClientMessage(playerid, COLOR_YELLOW,   "=============================================");
        format(string2, sizeof(string2), "Bem Vindo ao --------, %s",playername2);
        SendClientMessage(playerid, COLOR_MSG,string2);
        TextDrawHideForPlayer(playerid, bottomblack);
        TextDrawHideForPlayer(playerid, topblack);

        if (PlayerInfo[playerid][pVIP] == 3)
        {
            SendClientMessage(playerid, COLOR_MSG,"[---]:  Voce e jogador Vip [Normal]");
        }
        if (PlayerInfo[playerid][pVIP] == 4)
        {
            SendClientMessage(playerid, COLOR_MSG,"[---]:  Voce e jogador Vip [Premium]");
        }
        if (PlayerInfo[playerid][pAdmin] > 0)
        {
            format(string2, sizeof(string2), "[---]: Voce Logou Com Level %d de Admin.",PlayerInfo[playerid][pAdmin]);
            SendClientMessage(playerid, COLOR_MSG,string2);
        }
        {
            new string[128];
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "AdmAviso:%s estб logando....", playerid, sendername);
            ABroadCast(0x8080FFAA,string,1);
        }
        if (PlayerInfo[playerid][pSocio] > 0)
        {
            format(string2, sizeof(string2), "[---]: Voce Logou Com Level %d de Socio.",PlayerInfo[playerid][pSocio]);
            SendClientMessage(playerid, COLOR_MSG,string2);
        }
        SetSpawnInfo(playerid, PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pModel], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], 1.0, -1, -1, -1, -1, -1, -1);
        if(gTeam[playerid] == 0)
        {
            gTeam[playerid] = 3;
        }
        else
        {
            gTeam[playerid] = PlayerInfo[playerid][pTeam];
        }
        gPlayerLogged[playerid] = 1;
        spawnado[playerid] = 1;
        SpawnPlayer(playerid);
        format(tmp2, sizeof(tmp2), "~p~Bem vindo ~n~~b~   %s", playername2);
        DateProp(playerid);
        GameTextForPlayer(playerid, tmp2, 5000, 1);
        SendClientMessage(playerid, COLOR_YELLOW, motd);
        if((PlayerInfo[playerid][pAdmin] >= 1339) && (PlayerInfo[playerid][pAdmin] <= 5000))
        {
            new string[256];
            new AdminName[MAX_PLAYER_NAME];
            GetPlayerName(playerid, AdminName, sizeof(AdminName));
            format(string, sizeof(string), "~b~%s ~w~ON", AdminName);

                for(new i=0; i<MAX_PLAYERS; i++)
                {
                GameTextForPlayer(i, string , 5000, 1);
                }
        }

        if(PlayerInfo[playerid][pFMember] < 255)
        {
            format(tmp2, sizeof(tmp2), "Family MOTD: %s.", FamilyInfo[PlayerInfo[playerid][pFMember]][FamilyMOTD]);
            SendClientMessage(playerid, COLOR_YELLOW, tmp2);
        }
    }
    return 1;
}

stock ini_GetKey( line[] )
{
    new keyRes[256];
    keyRes[0] = 0;
    if ( strfind( line , "=" , true ) == -1 ) return keyRes;
    strmid( keyRes , line , 0 , strfind( line , "=" , true ) , sizeof( keyRes) );
    return keyRes;
}

stock ini_GetValue( line[] )
{
    new valRes[256];
    valRes[0]=0;
    if ( strfind( line , "=" , true ) == -1 ) return valRes;
    strmid( valRes , line , strfind( line , "=" , true )+1 , strlen( line ) , sizeof( valRes ) );
    return valRes;
}
public OnPlayerDeath:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new name[MAX_PLAYER_NAME];
    new string[256];
    new playercash;
    new victimteam;
    new Float:px,Float:py,Float:pz;
    new killerteam;
//- Hospital -
Hospital[playerid]++;
//------------
    victimteam = gTeam[playerid];
    killerteam = gTeam[killerid];
    gPlayerSpawned[playerid] = 1;
    GetPlayerName(playerid, name, sizeof(name));
    PlayerInfo[playerid][pLocal] = 255;
    GetPlayerPos(playerid, px, py, pz);
    SpawnPlayer(playerid);
//-----------------------------
    if(ProvocoMorro[playerid] == 1)
        {
            GangZoneStopFlashForAll(GZMorro);
            GangZoneShowForAll(GZMorro, 0xFFFFFF96);
            GuerranoMorro = 0;
            ProvocoMorro[playerid] = 0;
            donomorro = 0;
            Dominando[playerid] = 0;
            KillTimer(TempoGuerraMorro);
        }
        if(ProvocoSkate[playerid] == 1)
        {
            GangZoneStopFlashForAll(GZSkate);
            GangZoneShowForAll(GZSkate, 0xFFFFFF96);
            GuerranoSkate = 0;
            ProvocoSkate[playerid] = 0;
            donoskate = 0;
            Dominando[playerid] = 0;
            KillTimer(TempoGuerraSkate);
        }
        if(ProvocoShop[playerid] == 1)
        {
            GangZoneStopFlashForAll(GZShop);
            GangZoneShowForAll(GZShop, 0xFFFFFF96);
            GuerranoShop = 0;
            ProvocoShop[playerid] = 0;
            donoshop = 0;
            Dominando[playerid] = 0;
            KillTimer(TempoGuerraShop);
        }
        if(ProvocoAero[playerid] == 1)
        {
            GangZoneStopFlashForAll(GZPark);
            GangZoneShowForAll(GZPark, 0xFFFFFF96);
            GuerranoAero = 0;
            ProvocoAero[playerid] = 0;
            donopark = 0;
            Dominando[playerid] = 0;
            KillTimer(TempoGuerraPark);
        }
        if(ProvocoShopAban[playerid] == 1)
        {
            GangZoneStopFlashForAll(GZShopAban);
            GangZoneShowForAll(GZShopAban, 0xFFFFFF96);
            GuerranoShopAban = 0;
            ProvocoShopAban[playerid] = 0;
            donoShopAban = 0;
            Dominando[playerid] = 0;
            KillTimer(TempoGuerraShopAban);
        }
            if(ProvocoMafiaTroca[playerid] == 1)
        {
            GangZoneStopFlashForAll(MafiaTroca);
            GangZoneShowForAll(MafiaTroca, 0xFFFFFF96);
            GuerranoMafiaTroca = 0;
            ProvocoMafiaTroca[playerid] = 0;
            donoMafiaTroca = 0;
            Dominando[playerid] = 0;
            KillTimer(TempoGuerraMafiaTroca);
        }
          if(ProvocoCarandiru[playerid] == 1)
        {
            GangZoneStopFlashForAll(GZCarandiru);
            GangZoneShowForAll(GZCarandiru, 0xFFFFFF96);
            GuerranoCarandiru = 0;
            ProvocoCarandiru[playerid] = 0;
            donoCarandiru = 0;
            Dominando[playerid] = 0;
            KillTimer(TempoGuerraCarandiru);
        }
    if(GetPlayerState(killerid) == 2)
        {
            GetPlayerName(killerid,kickname,sizeof(kickname));
            format(string,sizeof(string),"Adm.Cmd: %s[ID:%d] Matou %s[ID:%d] Atropelado, e serб kickado pelo Admin",kickname,killerid,name,playerid);
            SendClientMessageToAll(COLOR_LIGHTRED,string);
            return 1;
        }
    if(reason == 38)
    {
        new kstring[128];
        new DBNameYEAH[MAX_PLAYER_NAME];
        if(IsPlayerConnected(killerid))
        {
            GetPlayerName(playerid, name, sizeof(name));
            GetPlayerName(killerid, DBNameYEAH, sizeof(DBNameYEAH));
            format(string, 256, "AdmAviso: [%d]%s usou minigun em %s.",killerid,DBNameYEAH,name);
            ABroadCast(COLOR_YELLOW,string,1);
            printf("%s", kstring);
        }
    }
    if(reason == 35)
    {
        new kstring[128];
        new DBNameYEAH[MAX_PLAYER_NAME];
        if(IsPlayerConnected(killerid))
        {
            GetPlayerName(killerid, DBNameYEAH, sizeof(DBNameYEAH));
            format(string, 256, "AdmAviso: [%d]%s usou Bazuka em %s.",killerid,DBNameYEAH,name);
            ABroadCast(COLOR_YELLOW,string,1);
            printf("%s", kstring);
        }
    }
    if(reason == 36)
    {
        new kstring[128];
        new DBNameYEAH[MAX_PLAYER_NAME];
        if(IsPlayerConnected(killerid))
        {
            GetPlayerName(killerid, DBNameYEAH, sizeof(DBNameYEAH));
            format(string, 256, "AdmAviso: [%d]%s usou Bazuka =2= em %s.",killerid,DBNameYEAH,name);
            ABroadCast(COLOR_YELLOW,string,1);
            printf("%s", kstring);
        }
    }
    if(reason == 26)
    {
        new kstring[128];
        new DBNameYEAH[MAX_PLAYER_NAME];
        if(IsPlayerConnected(killerid))
        {
            GetPlayerName(killerid, DBNameYEAH, sizeof(DBNameYEAH));
            format(string, 256, "AdmAviso: [%d]%s usou 12 Cano cerrado em %s.",killerid,DBNameYEAH,name);
            ABroadCast(COLOR_YELLOW,string,1);
            printf("%s", kstring);
        }
    }
    if(reason == 32)
    {
        new kstring[128];
        new DBNameYEAH[MAX_PLAYER_NAME];
        if(IsPlayerConnected(killerid))
        {
            GetPlayerName(killerid, DBNameYEAH, sizeof(DBNameYEAH));
            format(string, 256, "AdmAviso: [%d]%s usou TEC9 em %s.",killerid,DBNameYEAH,name);
            ABroadCast(COLOR_YELLOW,string,1);
            printf("%s", kstring);
        }
    }
    if(MISSAO[playerid] == 1)
    {
    SetPlayerName(playerid, "[GT3]");
    MISSAO[playerid] = 0;
    }

    if (gPlayerCheckpointStatus[playerid] > 4 && gPlayerCheckpointStatus[playerid] < 11)
    {
        DisablePlayerCheckpoint(playerid);
        gPlayerCheckpointStatus[playerid] = CHECKPOINT_Nenhum;
    }
    new caller = Mobile[playerid];
    if(caller != 255)
    {
        if(caller < 255)
        {
            SendClientMessage(caller,  COLOR_GRAD2, "Morreram do outro lado da linha....");
            CellTime[caller] = 0;
            CellTime[playerid] = 0;
            Mobile[caller] = 255;
        }
        Mobile[playerid] = 255;
        CellTime[playerid] = 0;
    }
    ClearCrime(playerid);
    if(PlayerPaintballing[playerid] != 0)
    {
        PlayerPaintballKills[killerid] ++;
        if(PlayerPaintballKills[killerid] > PaintballWinnerKills)
        {
            new killer[MAX_PLAYER_NAME];
            PaintballWinner = killerid;
            PaintballWinnerKills = PlayerPaintballKills[killerid];
            GetPlayerName(killerid, killer, sizeof(killer));
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    if(PlayerPaintballing[i] != 0)
                    {
                        format(string, sizeof(string), "* %s estб em 1є, Por Mata %d.",killer,PaintballWinnerKills);
                        SendClientMessage(i, COLOR_WHITE, string);
                    }
                }
            }
        }
        return 1;
    }
    if(GettingCK[playerid] < 999 || OnCK[playerid] < 999)
    {
        if(IsPlayerConnected(killerid))
        {
            if(GettingCK[killerid] < 999 || OnCK[playerid] < 999)
            {
                new killer[MAX_PLAYER_NAME];
                new dier[MAX_PLAYER_NAME];
                GetPlayerName(playerid, dier, sizeof(dier));
                GetPlayerName(killerid, killer, sizeof(killer));
                format(string, sizeof(string), "* %s vocк tomou um Char Kill, e nao podera mais jogar com este personagem.",killer);
                SendClientMessage(playerid, COLOR_LIGHTRED, string);
                format(string, sizeof(string), "** %s Char Morto Por %s **",killer,dier);
                CKLog(string);
                PlayerInfo[playerid][pCK] = 1;
                if(GettingCK[playerid] < 999) { GettingCK[playerid] = 999; }
                else if(OnCK[playerid] < 999) { OnCK[playerid] = 999; }
                if(GettingCK[killerid] < 999) { GettingCK[killerid] = 999; }
                else if(OnCK[killerid] < 999) { OnCK[killerid] = 999; }
                KickPlayer[playerid] = 1;
            }
        }
    }
    if(PlayerInfo[playerid][pHeadValue] > 0)
    {
        if(IsPlayerConnected(killerid))
        {
            if(gTeam[killerid] == 10 || PlayerInfo[killerid][pLider] == 8  || PlayerInfo[killerid][pMembro] == 8)
            {
                if(GoChase[killerid] == playerid)
                {
                    ConsumingMoney[killerid] = 1;
                    new killer[MAX_PLAYER_NAME];
                    GetPlayerName(killerid, killer, sizeof(killer));
                    GivePlayerMoneyEx(killerid, PlayerInfo[playerid][pHeadValue]);
                    format(string,128,"<< Assassino %s cumpriu o contrato em %s e ganhou R$%d >>",killer,name,PlayerInfo[playerid][pHeadValue]);
                    SendFamilyMessage(8, COLOR_YELLOW, string);
                    SendFamilyMessage(13, COLOR_YELLOW, string);
                    PlayerInfo[playerid][pHeadValue] = 0;
                    GotHit[playerid] = 0;
                    PlayerInfo[hitid][pMask] = 0;
                    GetChased[playerid] = 999;
                    GoChase[killerid] = 999;
                }
            }
        }
    }
    if(victimteam >= 4)
    {
        if(IsPlayerConnected(killerid))
        {
            //new killer[MAX_PLAYER_NAME];
            //GetPlayerName(killerid, killer, sizeof(killer));
            new slice = 100; //R$100
            playercash = GetPlayerMoneyEx(playerid);
            if(gTeam[killerid] != 2) { WantedPoints[killerid] += 2; } //+ 2 wanted points
            if(SafeTime[playerid] <= 0)
            {
                if(gTeam[killerid] != gTeam[playerid])
                {
                    if(GetPlayerState(killerid) == 1)
                    {
                        PlayerInfo[killerid][pKills] = PlayerInfo[killerid][pKills] + 2;
                    }
                    else
                    {
                        PlayerInfo[killerid][pKills]++;
                    }
                    PlayerInfo[playerid][pKills]--;
                }
            }
            /*if (strlen(deathreason) > 0)// patch
            {
                if (((gTeam[killerid]) == 1) || ((gTeam[killerid]) == 3 && civnokill) || gTeam[killerid] == gTeam[playerid])//med kill criminal
                {
                    format(string, sizeof(string), ".: %s murdered %s. (%s) :.", killer, name, deathreason);
                }
                else
                {
                    format(string, sizeof(string), ".: %s murdered %s. (%s) for R$%d :.", killer, name, deathreason, slice);
                }

            }
            else
            {
                if (((gTeam[killerid]) == 1) || ((gTeam[killerid]) == 3 && civnokill || gTeam[killerid] == gTeam[playerid]))
                {
                    format(string, sizeof(string), ".: %s murdered %s :.", killer, name);
                }
                else
                {
                    format(string, sizeof(string), ".: %s murdered %s for R$%d :.", killer, name, slice);
                }
            }*/

            if (((gTeam[killerid]) == 1) || ((gTeam[killerid]) == 3 && civnokill) || (gTeam[killerid] == gTeam[playerid] && gTeam[playerid] != 4))
            {
                slice = 0;
            }
            if (((gTeam[killerid]) != 4) && ((gTeam[killerid]) == gTeam[playerid]))//no team kill
            {
                slice = 0;
            }
            if (playercash > 0)
            {
                GivePlayerMoneyEx(playerid, -slice);
            }
            else
            {
                slice = slice+500;
            }
            GivePlayerMoneyEx(killerid, slice);
            //GameTextForPlayer(playerid, dmessage, 5000, 2);
            PlayerPlaySound(killerid, 1083, 0.0, 0.0, 0.0);
            if (((gTeam[killerid]) == 3) && reason != 49)
            {
                SetPlayerCriminal(killerid,255, "Assassinato em primeiro grau");
            }
            else if (((gTeam[killerid]) == 3) && reason == 49)
            {
                SetPlayerCriminal(killerid,255, "Assassinato, e fuga");
            }
        }
    }
    else if (victimteam == 2)
    {
        if(IsPlayerConnected(killerid))
        {
            //new killer[MAX_PLAYER_NAME];
            //GetPlayerName(killerid, killer, sizeof(killer));
            // Cop kill
            PlayerInfo[playerid][pKills]--;
            if (gTeam[killerid] == 2)//cops kill cop
            {
                //format(string,128,".: Officer %s murdered Officer %s (%s) and was sued for R$%d :.",killer,name,deathreason,suecost);
                PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
                GivePlayerMoneyEx(killerid, -suecost);
                GivePlayerMoneyEx(playerid, suecost+100);//+100pays hospital bill
            }
            else
            {
                //format(string,128,".: %s murdered Officer %s (%s) :.",killer,name,deathreason);
            }
            if (gTeam[killerid] >= 3)
            {
                WantedPoints[killerid] += 2; //+ 2 wanted points
                if(reason != 49)
                {
                    SetPlayerCriminal(killerid,255, "Assassinato em primeiro grau");
                }
                else if (reason == 49)
                {
                    SetPlayerCriminal(killerid,255, "Assassinato, e fuga");
                }
            }
            if(gTeam[killerid] >= 5 && SafeTime[playerid] <= 0)
            {
                if(GetPlayerState(killerid) == 1)
                {
                    PlayerInfo[killerid][pKills] = PlayerInfo[killerid][pKills]+2;
                }
                else
                {
                    PlayerInfo[killerid][pKills]++;
                }
                WantedPoints[killerid]+=2;
            }
            //BroadCast(COLOR_RED, string);
        }
    }
    else if (victimteam == 3)
    {
        if(IsPlayerConnected(killerid))
        {
            //new killer[MAX_PLAYER_NAME];
            //GetPlayerName(killerid, killer, sizeof(killer));
            // Civ kill
            if ((gTeam[killerid]) == 2)//cops kill civ
            {
                if(WantedLevel[playerid] < 1)
                {
                    //format(string,128,".: Officer %s murdered %s (%s) and was sued for R$%d :.",killer,name,deathreason,suecost);
                    PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
                    GivePlayerMoneyEx(killerid, -suecost);
                    GivePlayerMoneyEx(playerid, suecost+100);//+100pays hospital bill
                }
            }
            else
            {
                //format(string,128,".: %s murdered %s (%s) :.",killer,name,deathreason);
                WantedPoints[killerid] += 2;
            }
            if (((gTeam[killerid]) >= 3 || (gTeam[killerid]) == 1) && reason != 49)
            {
                SetPlayerCriminal(killerid,255, "Assassinato em primeiro grau");
            }
            else if (((gTeam[killerid]) >= 3 || (gTeam[killerid]) == 1) && reason == 49)
            {
                SetPlayerCriminal(killerid,255, "Assassinato, e fuga");
            }
            //BroadCast(COLOR_RED, string);
        }
    }
    else if (victimteam == 1)
    {
        if(IsPlayerConnected(killerid))
        {
            //new killer[MAX_PLAYER_NAME];
            //GetPlayerName(killerid, killer, sizeof(killer));
            // Civ kill
            if ((gTeam[killerid]) == 2)//cops kill civ
            {
                //format(string,128,".: Officer %s murdered SAMU %s (%s) and was sued for R$%d :.",killer,name,deathreason,suecost);
                PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
                GivePlayerMoneyEx(killerid, -suecost);
                GivePlayerMoneyEx(playerid, suecost+100);//+100pays hospital bill
            }
            else if ((gTeam[killerid]) == 1)//med kill civ
            {
                //format(string,128,".: SAMU %s murdered %s (%s) and was sued for R$%d :.",killer,name,deathreason,suecost);
                PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
                GivePlayerMoneyEx(killerid, -suecost);
                GivePlayerMoneyEx(playerid, suecost+100);//+100pays hospital bill
            }
            else
            {
                //format(string,128,".: %s murdered %s (%s) :.",killer,name,deathreason);
            }
            if (((gTeam[killerid]) == 4) && reason != 49)
            {
                SetPlayerCriminal(killerid,255, "Assassinato em primeiro grau");
            }
            else if (((gTeam[killerid]) == 3) && reason == 49)
            {
                SetPlayerCriminal(killerid,255, "Assassinato, e fuga");
            }
            //BroadCast(COLOR_RED, string);
        }
    }
    if (victimteam >= 3 && WantedPoints[playerid] > 0 && killerteam == 2)
    {
        SetPlayerFree(playerid,killerid, "Foi morto");
    }
    killerid = INVALID_PLAYER_ID;
    SetPlayerColor(playerid,COLOR_GRAD2);
    return 1;
}
o problema й que quando loga spawna as vezes, nem sempre (nгo sei pq) e quando morre vai pra tela de login ao invйs de ir pro hospital O.o
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)