[Ajuda] Local de Spawn
#1

Olha to adaptando um sistema de equipes do rjjj, mas ja tem um cmd no GM que define o local de spawn do player ao ser spawnado

Que e esse:

PHP код:
    if(strcmp(cmd"/localSpawn"true) == 0)
    {
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp))
        {
            
SendClientMessage(playeridCOLOR_GREY"|________________________________________|");
            
SendClientMessage(playeridCOLOR_WHITE"/Localspawn [nome]");
            
SendClientMessage(playeridCOLOR_WHITE"Nomes: HQ, Casa");
            
SendClientMessage(playeridCOLOR_GREY"|________________________________________|");
            return 
1;
        }
        if(
strcmp(tmp"hq"true) == 0)
        {
            if(
PlayerInfo[playerid][pPhousekey] != 255)
            {
                
LocalSpawn[playerid] = 0;
                
SendClientMessage(playeridCOLOR_GREY"Agora voce ira spawnar na HQ");
                return 
1;
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GREY"Voce precisa ter casa para usar esse comando");
                return 
1;
            }
        }
        else if(
strcmp(tmp"casa"true) == 0)
        {
            if(
PlayerInfo[playerid][pPhousekey] != 255)
            {
                
LocalSpawn[playerid] = 1;
                
SendClientMessage(playeridCOLOR_GREY"Agora voce ira spawnar em casa");
                return 
1;
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GREY"Voce precisa ter casa para usar esse comando");
                return 
1;
            }
        }
        else {
            
SendClientMessage(playeridCOLOR_GREY"/Localspawn [nome]");
            return 
1;
        }
    } 
mas queria que no comando tivesse o if(strcmp(tmp, "equipe", true) == 0), como o spawn e salvo diferente da maneira "normal" do GM nao faso ideal de como fazer isso to pedindo a juda de vcs =D

Ao salvar
PHP код:
            if(PlayerTemEquipe[playerid])
            {
                if(
listitem == 1)
                {
                    if(
GetPlayerGP(playerid) < 50000) return SendClientMessage(playerid,0x33CCFFAA,"[Server Info] Vocк nгo tem dinheiro suficiente !");
                    if(
PlayerInfo[playerid][pDonateRank] < 1) return SendClientMessage(playerid,0x33CCFFAA,"[Server Info] Vocк nгo e um VIP !");
                    
ShowPlayerDialog(playerid,OpcoesPainelDIALOG_STYLE_INPUT,
                      
"[ -- Equipes - Opзхes -- ]""[ --- Spawn --- ]\n\nDigite as Coordenadas X,Y,Z do Local de Spawn da Sua familia no seguinte formato:\n\nX,Y,Z\n\nEm seguinda pressione OK.\nObs:Para que o Local de Spawn seja onde vocк estб no momento, digite no espaзo abaixo:  Local.\n\n",
                     
"OK""Sair");
                    
SetPVarInt(playerid,"PainelValue",2);
                    return 
1;
                } 
PHP код:
enum InGameStatus
{
    
Equipe[40],Tag[10],Cor,Float:SpawnGameX,Float:SpawnGameY,Float:SpawnGameZ,SkinEquipeGame1,SkinEquipeGame2,SkinEquipeGame3,
}
new 
InGame[MAX_PLAYERS][InGameStatus];
new 
bool:Spawned[MAX_PLAYERS]; 
Salva nas scriptfiles

PHP код:
    if(!Spawned[playerid])
    {
        
Spawned[playerid] = true;
        new 
NickName[MAX_PLAYER_NAME],text[100];
        
GetPlayerName(playerid,NickName,sizeof(NickName));
        
format(text,sizeof(text),"/Equipes/%s.txt",NickName);
        if(!
Fini_Exists(text))
        {
            
Fini_Create(text);
            
Fini_OpenFile(text);
               
Fini_SetStr("RecrutaDeOutroPlayer",PlayerRecrutaDeOutroPlayer[playerid]);
            
Fini_SetStr("NomeEquipe",PlayerEquipe[playerid]);
            
Fini_SetStr("Tag",EquipeTag[playerid]);
            
Fini_SetVal("Cor",CorEquipe[playerid]);
            
Fini_SetFloat("SpawnX",Spawn[playerid][0]);
            
Fini_SetFloat("SpawnY",Spawn[playerid][1]);
            
Fini_SetFloat("SpawnZ",Spawn[playerid][2]);
            
Fini_SetVal("Skin1",SkinEquipe[playerid][0]);
            
Fini_SetVal("Skin2",SkinEquipe[playerid][1]);
            
Fini_SetVal("Skin3",SkinEquipe[playerid][2]);
            
Fini_SetVal("Cargo",RankPlayer[playerid]);
            
Fini_SetBool("PlayerTemEquipe",PlayerTemEquipe[playerid]);
            
Fini_SetBool("PlayerMembroEquipe",PlayerMembroEquipe[playerid]);
            
Fini_SaveFile();
            
Fini_CloseFile();
        }
        else
        {
            
Fini_OpenFile(text);
            
strmid(PlayerRecrutaDeOutroPlayer[playerid],Fini_GetStr("RecrutaDeOutroPlayer"),false,strlen(Fini_GetStr("RecrutaDeOutroPlayer")),MAX_PLAYER_NAME);
            
strdel(PlayerRecrutaDeOutroPlayer[playerid],(strlen(PlayerRecrutaDeOutroPlayer[playerid])-2),(strlen(PlayerRecrutaDeOutroPlayer[playerid])));
            
format(string,sizeof(string),"/Equipes/%s.txt",PlayerRecrutaDeOutroPlayer[playerid]);
            
RankPlayer[playerid] = Fini_GetValue("Cargo");
            
PlayerTemEquipe[playerid] = (Fini_GetBool("PlayerTemEquipe") == 1) ? true false;
            
PlayerMembroEquipe[playerid] = (Fini_GetBool("PlayerMembroEquipe") == 1) ? true false;
            
Fini_SaveFile();
            
Fini_CloseFile();
            if(
strlen(PlayerRecrutaDeOutroPlayer[playerid]) > 2)
            {
                if(
Fini_Exists(string))
                {
                    
Fini_OpenFile(string);
                    
strmid(InGame[playerid][Equipe],Fini_GetStr("NomeEquipe"),false,strlen(Fini_GetStr("NomeEquipe")),MAX_PLAYER_NAME);
                    
strmid(InGame[playerid][Tag],Fini_GetStr("Tag"),false,strlen(Fini_GetStr("Tag")),10);
                    
InGame[playerid][Cor] = Fini_GetValue("Cor");
                    
InGame[playerid][SpawnGameX] = Fini_GetFloat("SpawnX");
                    
InGame[playerid][SpawnGameY] = Fini_GetFloat("SpawnY");
                    
InGame[playerid][SpawnGameZ] = Fini_GetFloat("SpawnZ");
                    
InGame[playerid][SkinEquipeGame1] = Fini_GetValue("Skin1");
                    
InGame[playerid][SkinEquipeGame2] = Fini_GetValue("Skin2");
                    
InGame[playerid][SkinEquipeGame3] = Fini_GetValue("Skin3");
                       
Fini_SaveFile();
                    
Fini_CloseFile();
                    
SetPlayerColor(playerid,InGame[playerid][Cor]);
                    
SetPlayerPos(playerid,InGame[playerid][SpawnGameX],InGame[playerid][SpawnGameY],InGame[playerid][SpawnGameZ]);
                    new 
Roll random(2);
                    if(
Roll == 0SetPlayerSkin(playerid,InGame[playerid][SkinEquipeGame1]);
                    else if(
Roll == 1SetPlayerSkin(playerid,InGame[playerid][SkinEquipeGame1]);
                    else if(
Roll == 2SetPlayerSkin(playerid,InGame[playerid][SkinEquipeGame1]);
                    
GetPVarString(playerid"Nome Original"AtualNomesizeof(AtualNome));
                    
format(NovoNome,40,"[%s]%s",InGame[playerid][Tag],AtualNome);
                    
SetPlayerName(playerid,NovoNome);
                    
SetSpawnInfo(playeridGetPlayerTeam(playerid),GetPlayerSkin(playerid),InGame[playerid][SpawnGameX],InGame[playerid][SpawnGameY],InGame[playerid][SpawnGameZ], 0000000);
                }
            }
        }
    } 
Reply


Messages In This Thread
Local de Spawn - by LeonardoBCF - 01.05.2013, 21:43
Re: Local de Spawn - by FixSkuL - 01.05.2013, 21:46
Re: Local de Spawn - by LeonardoBCF - 01.05.2013, 21:55
Re: Local de Spawn - by FixSkuL - 01.05.2013, 21:59
Re: Local de Spawn - by LeonardoBCF - 01.05.2013, 22:19
Re: Local de Spawn - by FixSkuL - 01.05.2013, 22:24
Re: Local de Spawn - by LeonardoBCF - 01.05.2013, 22:29

Forum Jump:


Users browsing this thread: 1 Guest(s)