SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 08/09/2011, 03:52 AM   #1
Guilherme_Canani
Huge Clucker
 
Join Date: Nov 2009
Posts: 253
Reputation: 1
Question [DUVIDA] Sist de Registro LARP

Estou a bastante tempo sem codar, e resolvi codar novamente um LA-RP.
Estou fazendo um GM Bilíngue, baseado no sistema do meu GameMode Gangs TDM.
Coloquei para que a primeira coisa que o jogador fizesse seria escolher o idioma, até aí tudo bem, ele escolhe por dois comandos /portugues ou /english e fica salvo na conta dele tudo certinho e as mensagens vão no idioma dele. O problema é que eu posso digitar quantas vezes quiser que ele não passa para outras fazes do Tutorial.

pawn Code:
//Set Player Spawn

RegistrationStep[playerid] = 1;            
SendClientMessage(playerid, COLOR_YELLOW, "Welcome to Los Angeles RolePlay. You will now be taken to Immigration.");            
SendClientMessage(playerid, COLOR_LIGHTRED, "Você fala Português?? (/portugues), ou/or Do You Speak English?? (/english)");

//Comandos
   //-----------IDIOMA-----------------    
    if(strcmp(cmd,"/portugues", true) ==0)    
    {    
        if(IsPlayerConnected(playerid))        
        {        
           if(gPlayerLogged[playerid] == 1)          
           {                                    
               SendClientMessage(playerid, COLOR_WHITE, "SERVER: Okay, você fala Português.");              
               PlayerInfo[playerid][pIdioma] = 1;
               RegistrationStep[playerid] = 2;              
           }          
        }        
        return 1;        
    }                                            

    if(strcmp(cmd,"/english", true) ==0)    
    {
        if(IsPlayerConnected(playerid))        
        {        
           if(gPlayerLogged[playerid] == 1)          
           {                                    
               SendClientMessage(playerid, COLOR_WHITE, "SERVER: Okay, you speak English.");                  
               PlayerInfo[playerid][pIdioma] = 2;
               RegistrationStep[playerid] = 2;              
           }          
        }        
        return 1;        
    }        

//OnPlayerText

    if(RegistrationStep[playerid] > 0)
    {
        if(RegistrationStep[playerid] == 2)
        {                  
            SendClientMessage(playerid, COLOR_YELLOW, "Okay, agora as perguntas");
            SendClientMessage(playerid, COLOR_LIGHTRED, "First question: Are you a Male or Female? (Type in what you are).");
            new idx;
            tmp = strtok(text, idx);
            if((strcmp("male", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("male")))
            {
                PlayerInfo[playerid][pSex] = 1;
                SendClientMessage(playerid, COLOR_YELLOW2, "Ok, so you are a Male.");
                SendClientMessage(playerid, COLOR_LIGHTRED, "What is your birthdate? (Use dd/mm/yyyy)");
                new maleskin;
                maleskin = random(sizeof(CivMalePeds));
                SetPlayerSkin(playerid, maleskin);
                PlayerInfo[playerid][pChar] = maleskin;
                RegistrationStep[playerid] = 3;
                return 0;
            }
            else if((strcmp("female", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("female")))
            {
                PlayerInfo[playerid][pSex] = 2;
                SendClientMessage(playerid, COLOR_YELLOW2, "Ok, so you are a Female.");
                SendClientMessage(playerid, COLOR_LIGHTRED, "What is your birthdate? (Use dd/mm/yyyy)");
                new femaleskin;
                femaleskin = random(sizeof(CivFemalePeds));
                SetPlayerSkin(playerid, femaleskin);
                SetPlayerSkin(playerid, femaleskin);
                PlayerInfo[playerid][pChar] = femaleskin;
                RegistrationStep[playerid] = 3;
                return 0;
            }
            else
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "Are you a Male or Female? (Type in what you are).");
            }
            return 0;
        }
Guilherme_Canani is offline   Reply With Quote
Old 08/09/2011, 05:51 AM   #2
WLSF
High-roller
 
Join Date: Aug 2011
Posts: 3,541
Reputation: 787
Default Re: [DUVIDA] Sist de Registro LARP

Usa só assim então, vê se vai...
pawn Code:
//Set Player Spawn

RegistrationStep[playerid] = 1;            
SendClientMessage(playerid, COLOR_YELLOW, "Welcome to Los Angeles RolePlay. You will now be taken to Immigration.");            
SendClientMessage(playerid, COLOR_LIGHTRED, "Você fala Português?? (/portugues), ou/or Do You Speak English?? (/english)");

//Comandos
   //-----------IDIOMA-----------------    
    if(strcmp(cmd,"/portugues", true) ==0)    
    {    
        if(IsPlayerConnected(playerid))        
        {        
           if(gPlayerLogged[playerid] == 1)          
           {                                    
               SendClientMessage(playerid, COLOR_WHITE, "SERVER: Okay, você fala Português.");              
               PlayerInfo[playerid][pIdioma] = 1;
               RegistrationStep[playerid] = 2;              
           }          
        }        
        return 1;        
    }                                            

    if(strcmp(cmd,"/english", true) ==0)    
    {
        if(IsPlayerConnected(playerid))        
        {        
           if(gPlayerLogged[playerid] == 1)          
           {                                    
               SendClientMessage(playerid, COLOR_WHITE, "SERVER: Okay, you speak English.");                  
               PlayerInfo[playerid][pIdioma] = 2;
               RegistrationStep[playerid] = 2;              
           }          
        }        
        return 1;        
    }        

//OnPlayerText

        if(RegistrationStep[playerid] == 2)
        {                  
            SendClientMessage(playerid, COLOR_YELLOW, "Okay, agora as perguntas");
            SendClientMessage(playerid, COLOR_LIGHTRED, "First question: Are you a Male or Female? (Type in what you are).");
            new idx;
            tmp = strtok(text, idx);
            if((strcmp("male", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("male")))
            {
                PlayerInfo[playerid][pSex] = 1;
                SendClientMessage(playerid, COLOR_YELLOW2, "Ok, so you are a Male.");
                SendClientMessage(playerid, COLOR_LIGHTRED, "What is your birthdate? (Use dd/mm/yyyy)");
                new maleskin;
                maleskin = random(sizeof(CivMalePeds));
                SetPlayerSkin(playerid, maleskin);
                PlayerInfo[playerid][pChar] = maleskin;
                RegistrationStep[playerid] = 3;
                return 0;
            }
            else if((strcmp("female", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("female")))
            {
                PlayerInfo[playerid][pSex] = 2;
                SendClientMessage(playerid, COLOR_YELLOW2, "Ok, so you are a Female.");
                SendClientMessage(playerid, COLOR_LIGHTRED, "What is your birthdate? (Use dd/mm/yyyy)");
                new femaleskin;
                femaleskin = random(sizeof(CivFemalePeds));
                SetPlayerSkin(playerid, femaleskin);
                SetPlayerSkin(playerid, femaleskin);
                PlayerInfo[playerid][pChar] = femaleskin;
                RegistrationStep[playerid] = 3;
                return 0;
            }
            else
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "Are you a Male or Female? (Type in what you are).");
            return 1;
        }
WLSF is offline   Reply With Quote
Old 08/09/2011, 12:55 PM   #3
Guilherme_Canani
Huge Clucker
 
Join Date: Nov 2009
Posts: 253
Reputation: 1
Default Re: [DUVIDA] Sist de Registro LARP

26 Erros... Todos sobre Variáveis.
Guilherme_Canani is offline   Reply With Quote
Old 08/09/2011, 01:18 PM   #4
Designer Vibe02
Big Clucker
 
Join Date: Nov 2010
Posts: 66
Reputation: 5
Default Re: [DUVIDA] Sist de Registro LARP

olha não sei bem se irá funcionar porque estou sem o la-rp para testar mas teste e vê se funciona ok Abraços

Quote:
#include <a_samp>
//Set Player Spawn

RegistrationStep[playerid] = 1;
SendClientMessage(playerid, COLOR_YELLOW, "Welcome to Los Angeles RolePlay. You will now be taken to Immigration.");
SendClientMessage(playerid, COLOR_LIGHTRED, "Você fala Português?? (/portugues), ou/or Do You Speak English?? (/english)");

//Comandos
//-----------IDIOMA-----------------
if(strcmp(cmd,"/portugues", true) ==0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: Okay, você fala Português.");
PlayerInfo[playerid][pIdioma] = 1;
RegistrationStep[playerid] = 2;
}
}
return 1;
}

if(strcmp(cmd,"/english", true) ==0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: Okay, you speak English.");
PlayerInfo[playerid][pIdioma] = 2;
RegistrationStep[playerid] = 2;
}
}
return 1;
}

//OnPlayerText

if(RegistrationStep[playerid] > 0)
{
if(RegistrationStep[playerid] == 2 && PlayerInfo[playerid][pIdioma]==2)
{
SendClientMessage(playerid, COLOR_YELLOW, "Okay, now answer the questions!");
SendClientMessage(playerid, COLOR_LIGHTRED, "First question: Are you a Male or Female? (Type in what you are).");
new idx;
tmp = strtok(text, idx);
if((strcmp("male", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("male")))
{
PlayerInfo[playerid][pSex] = 1;
SendClientMessage(playerid, COLOR_YELLOW2, "Ok, so you are a Male.");
SendClientMessage(playerid, COLOR_LIGHTRED, "What is your birthdate? (Use dd/mm/yyyy)");
new maleskin;
maleskin = random(sizeof(CivMalePeds));
SetPlayerSkin(playerid, maleskin);
PlayerInfo[playerid][pChar] = maleskin;
RegistrationStep[playerid] = 3;
return 0;
}
else if((strcmp("female", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("female")))
{
PlayerInfo[playerid][pSex] = 2;
SendClientMessage(playerid, COLOR_YELLOW2, "Ok, so you are a Female.");
SendClientMessage(playerid, COLOR_LIGHTRED, "What is your birthdate? (Use dd/mm/yyyy)");
new femaleskin;
femaleskin = random(sizeof(CivFemalePeds));
SetPlayerSkin(playerid, femaleskin);
SetPlayerSkin(playerid, femaleskin);
PlayerInfo[playerid][pChar] = femaleskin;
RegistrationStep[playerid] = 3;
return 0;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Are you a Male or Female? (Type in what you are).");
}
return 0;
}
else if(RegistrationStep[playerid] == 2 && PlayerInfo[playerid][pIdioma]==1)
{
SendClientMessage(playerid, COLOR_YELLOW, "Okay, agora as perguntas");
SendClientMessage(playerid, COLOR_LIGHTRED, "Primeira Pergunta: Você é Homem Ou Mulher? (digite sua resposta)");
new idx;
tmp = strtok(text, idx);
if((strcmp("homem", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("homem")))
{
PlayerInfo[playerid][pSex] = 1;
SendClientMessage(playerid, COLOR_YELLOW2, "Ok, Você é Homem.");
SendClientMessage(playerid, COLOR_LIGHTRED, "Qual Seu Aniversário? (Use dd/mm/yyyy)");
new maleskin;
maleskin = random(sizeof(CivMalePeds));
SetPlayerSkin(playerid, maleskin);
PlayerInfo[playerid][pChar] = maleskin;
RegistrationStep[playerid] = 3;
return 0;
}
else if((strcmp("mulher", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("mulher")))
{
PlayerInfo[playerid][pSex] = 2;
SendClientMessage(playerid, COLOR_YELLOW2, "Ok, so you are a Female.");
SendClientMessage(playerid, COLOR_LIGHTRED, "Qual Seu Aniversário? (Use dd/mm/yyyy)");
new femaleskin;
femaleskin = random(sizeof(CivFemalePeds));
SetPlayerSkin(playerid, femaleskin);
SetPlayerSkin(playerid, femaleskin);
PlayerInfo[playerid][pChar] = femaleskin;
RegistrationStep[playerid] = 3;
return 0;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Você é Homem Ou Mulher? (digite sua resposta).");
}
return 0;
}
}
Se Tiver Duvidas : davidchristia@gmail.com
Designer Vibe02 is offline   Reply With Quote
Old 08/09/2011, 01:42 PM   #5
Guilherme_Canani
Huge Clucker
 
Join Date: Nov 2009
Posts: 253
Reputation: 1
Default Re: [DUVIDA] Sist de Registro LARP

Funcionou, só que preciso digitar qualquer coisa no chat normal para ele avançar...
Guilherme_Canani is offline   Reply With Quote
Old 09/09/2011, 05:49 AM   #6
StrondA_
Gangsta
 
StrondA_'s Avatar
 
Join Date: Feb 2011
Posts: 894
Reputation: 12
Default Re: [DUVIDA] Sist de Registro LARP

Quote:
Originally Posted by Designer Vibe02 View Post
olha não sei bem se irá funcionar porque estou sem o la-rp para testar mas teste e vê se funciona ok Abraços



Se Tiver Duvidas : davidchristia@gmail.com
['pawn']['/pawn'] owna!
__________________
- which the logic programming without creativity?
StrondA_ is offline   Reply With Quote
Old 09/09/2011, 05:58 AM   #7
WLSF
High-roller
 
Join Date: Aug 2011
Posts: 3,541
Reputation: 787
Default Re: [DUVIDA] Sist de Registro LARP

Eu passei tudo pro dialog, ficou até melhor... e não teve esse erro, e.e
WLSF is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problema no Registro LARP GuikBretas Português/Portuguese 6 19/12/2010 07:32 PM
[Duvida]Registro keller012 Português/Portuguese 9 01/08/2010 10:19 PM


All times are GMT. The time now is 12:10 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.