01.05.2013, 21:43 
	
	
	
		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:
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
Salva nas scriptfiles
	
	
	
	
Que e esse:
PHP код:
    if(strcmp(cmd, "/localSpawn", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_GREY, "|________________________________________|");
            SendClientMessage(playerid, COLOR_WHITE, "/Localspawn [nome]");
            SendClientMessage(playerid, COLOR_WHITE, "Nomes: HQ, Casa");
            SendClientMessage(playerid, COLOR_GREY, "|________________________________________|");
            return 1;
        }
        if(strcmp(tmp, "hq", true) == 0)
        {
            if(PlayerInfo[playerid][pPhousekey] != 255)
            {
                LocalSpawn[playerid] = 0;
                SendClientMessage(playerid, COLOR_GREY, "Agora voce ira spawnar na HQ");
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_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(playerid, COLOR_GREY, "Agora voce ira spawnar em casa");
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "Voce precisa ter casa para usar esse comando");
                return 1;
            }
        }
        else {
            SendClientMessage(playerid, COLOR_GREY, "/Localspawn [nome]");
            return 1;
        }
    } 
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,OpcoesPainel, DIALOG_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]; 
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 == 0) SetPlayerSkin(playerid,InGame[playerid][SkinEquipeGame1]);
                    else if(Roll == 1) SetPlayerSkin(playerid,InGame[playerid][SkinEquipeGame1]);
                    else if(Roll == 2) SetPlayerSkin(playerid,InGame[playerid][SkinEquipeGame1]);
                    GetPVarString(playerid, "Nome Original", AtualNome, sizeof(AtualNome));
                    format(NovoNome,40,"[%s]%s",InGame[playerid][Tag],AtualNome);
                    SetPlayerName(playerid,NovoNome);
                    SetSpawnInfo(playerid, GetPlayerTeam(playerid),GetPlayerSkin(playerid),InGame[playerid][SpawnGameX],InGame[playerid][SpawnGameY],InGame[playerid][SpawnGameZ], 0, 0, 0, 0, 0, 0, 0);
                }
            }
        }
    } 

