[URGENTE]Ajuda -
rene20 - 04.10.2010
To precisando urgente de ageita essas chaves
so eu coloca o code e da erro
pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(Engine[vehicleid] == 0)
{
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid, AMARELO, "Precione (Shift/Spaзo) ou digite /ligarv para ligar seu veiculo");
}
if(Freio[vehicleid] == 0)
{
SendClientMessage(playerid, VERMELHO, "Freio de mгo puxado! Tire o Freio de mгo para proseguir. (/freio)");
TogglePlayerControllable(playerid,0);
}
if(Freio[vehicleid] == 1)
{
SendClientMessage(playerid, VERMELHO, "Carro sem freio de mгo! Pode andar normalmente.");
SendClientMessage(playerid, VERMELHO, "Bote o freio de mгo com (/freio)");
TogglePlayerControllable(playerid,1);
}
}
return 1;
}
Re: [URGENTE]Ajuda -
Lуs - 04.10.2010
Testa ae:
pawn Код:
if(newstate == PLAYER_STATE_DRIVER) { new vehicleid = GetPlayerVehicleID(playerid); if(Engine[vehicleid] == 0) { TogglePlayerControllable(playerid, 0); SendClientMessage(playerid, AMARELO, "Precione (Shift/Spaзo) ou digite /ligarv para ligar seu veiculo"); } if(Freio[vehicleid] == 0) { SendClientMessage(playerid, VERMELHO, "Freio de mгo puxado! Tire o Freio de mгo para proseguir. (/freio)"); TogglePlayerControllable(playerid,0); } if(Freio[vehicleid] == 1) { SendClientMessage(playerid, VERMELHO, "Carro sem freio de mгo! Pode andar normalmente."); SendClientMessage(playerid, VERMELHO, "Bote o freio de mгo com (/freio)"); TogglePlayerControllable(playerid,1); } }
To no curso, entгo nem testei
Re: [URGENTE]Ajuda -
rene20 - 04.10.2010
Fuciono
Mas fui termina com os outros ai deu
erro nesse
pawn Код:
//---------------------------<[ OnPlayerCommandText ]>--------------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[256];
new playerdinheiro;
new giveplayer[MAX_PLAYER_NAME];
new playername[MAX_PLAYER_NAME];
new cmd[256];
new tmp[256];
new vehicleid = GetPlayerVehicleID(playerid);
new giveplayerid, moneys, idx;
cmd = strtok(cmdtext, idx);
/* CREEEEEEEEEEEEEEEEEEEEEUUUUUUUUUUUUUUUUUU */
if(strcmp(cmd, "/creu", true) == 0 || strcmp(cmd, "/crйu", true) == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s estб danзando o Crйu.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ApplyAnimation(playerid,"CHOPPA","CHOPPA_back",4.1,1,1,1,1,1);
SendClientMessage(playerid, COLOR_DBLUE, "ЙЙЙЙ Creeeeeeu!");
return 1;
}
if(strcmp(cmd, "/cvip", true) == 0 || strcmp(cmd, "/chatvip", true) == 0)
{
if(IsPlayerConnected(playerid) && PlayerInfo[playerid][pVIP] >= 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USO: /cvip [Chat Vip]");
return 1;
}
format(string, sizeof(string), "** VIP %s: %s", sendername, result);
SendVIPMessage(0xFFCCFFAA,string);
printf("VIP %s: %s", sendername, result);
}
return 1;
}
if (strcmp(cmd, "/infodacasa", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (gPlayerLogged[playerid] != 0)
{
InfoDaCasa();
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s olha as info da casa.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Voce nao esta logado !");
}
}
return 1;
}
if(!strcmp(cmdtext, "/cinto", true))
{
if(CintoPlayer[playerid]==1) return SendClientMessage(playerid,0x00FF00AA,"Vocк ja esta de Cinto");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0x00FF00AA,"Vocк nгo esta em um Carro");
CintoPlayer[playerid] = 1;
SendClientMessage(playerid,VERDE,"[AVISO]: Parabйns Vocк esta de Cinto, Agora Esta Protegido (/tirarcinto)");
SetPlayerWantedLevel(playerid, 0);
return 1;
}
if(!strcmp(cmdtext, "/tirarcinto", true))
{
if(!IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid,0x00FF00AA,"Vocк nгo esta em um Carro");
if(CintoPlayer[playerid]==0) return SendClientMessage(playerid,0x00FF00AA,"Vocк nгo esta de Cinto");
CintoPlayer[playerid] = 0;
SendClientMessage(playerid,AMARELO,"[AVISO]: Cuidado Vocк Esta Sem Cinto, Pode Morrer (/cinto)");
SetPlayerWantedLevel(playerid, 0);
return 1;
}
if(strcmp(cmdtext, "/ligarv", true) == 0)
{
if(Engine[vehicleid] == 0)
{
SendClientMessage(playerid, VERDE, "Ligando veiculo...");
SetTimerEx("EngineTimer", 2000, 0, "i", playerid);
}
else if(Engine[vehicleid] == 1)
{
SendClientMessage(playerid, AMARELO, "Seu veiculo ja estб ligado!.");
}
return 1;
}
if(strcmp(cmdtext, "/desligarv", true) == 0)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(Engine[vehicleid] == 1)
{
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, VERMELHO, "Saia do veiculo digitando /sairv.");
Engine[vehicleid] = 0;
TogglePlayerControllable(playerid, 0);
}
else
{
SendClientMessage(playerid, VERMELHO, "Vocк nгo estб em um veiculo.");
}
}
return 1;
}
if(strcmp(cmd, "/sairv", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
}
return 1;
}
if(strcmp(cmdtext, "/freio", true) == 0)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(Engine[vehicleid] == 1)
{
if(Freio[vehicleid] == 0)
{
SendClientMessage(playerid, VERMELHO, "Quando quizer por o freio de mгo, use /freio novamente");
Freio[vehicleid] = 1;
TogglePlayerControllable(playerid,1);
}
else if(Freio[vehicleid] == 1)
{
SendClientMessage(playerid, VERMELHO, "Saia do veiculo apertando (Enter), (F) ou digitando /sair.");
SendClientMessage(playerid, VERDE, "Quando quizer tirar o freio de mгo, use /freio novamente");
Freio[vehicleid] = 0;
TogglePlayerControllable(playerid,0);
}
}
else
{
SendClientMessage(playerid, VERMELHO, "Ligue o veiculo antes de mexer no freio de mгo!.");
}
return 1;
}
return 0;
}
pode ageita pra min ?
Re: [URGENTE]Ajuda -
zSuYaNw - 04.10.2010
Como Funciona As Chaves? ( { } )
As Chaves funcionao assim:
Exemplo de um public:
Код:
public OnPlayerText(playerid,text[])
{// ABRE
return 1;
}// FECHA
Um Comando
Код:
if(strcmp(cmdtext,"/check", true) == 0)
{// ABRE
if(IsPlayerConnected(playerid))
{// ABRE
if(IsPlayerInAdmin(playerid))
{// ABRE
}//FECHA
}//FECHA
return 1;
}//FECHA
Os cуdigos sitados eu usei '['code] ['/code] Para Distacar.
pawn Код:
//---------------------------<[ OnPlayerCommandText ]>--------------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[256];
new playerdinheiro;
new giveplayer[MAX_PLAYER_NAME];
new playername[MAX_PLAYER_NAME];
new cmd[256];
new tmp[256];
new vehicleid = GetPlayerVehicleID(playerid);
new giveplayerid, moneys, idx;
cmd = strtok(cmdtext, idx);
/* CREEEEEEEEEEEEEEEEEEEEEUUUUUUUUUUUUUUUUUU */
if(strcmp(cmd, "/creu", true) == 0 || strcmp(cmd, "/crйu", true) == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s estб danзando o Crйu.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ApplyAnimation(playerid,"CHOPPA","CHOPPA_back",4.1,1,1,1,1,1);
SendClientMessage(playerid, COLOR_DBLUE, "ЙЙЙЙ Creeeeeeu!");
return 1;
}
if(strcmp(cmd, "/cvip", true) == 0 || strcmp(cmd, "/chatvip", true) == 0)
{
if(IsPlayerConnected(playerid) && PlayerInfo[playerid][pVIP] >= 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USO: /cvip [Chat Vip]");
return 1;
}
format(string, sizeof(string), "** VIP %s: %s", sendername, result);
SendVIPMessage(0xFFCCFFAA,string);
printf("VIP %s: %s", sendername, result);
}
return 1;
}
if (strcmp(cmd, "/infodacasa", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (gPlayerLogged[playerid] != 0)
{
InfoDaCasa();
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s olha as info da casa.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Voce nao esta logado !");
}
}
return 1;
}
if(!strcmp(cmdtext, "/cinto", true))
{
if(CintoPlayer[playerid]==1) return SendClientMessage(playerid,0x00FF00AA,"Vocк ja esta de Cinto");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0x00FF00AA,"Vocк nгo esta em um Carro");
CintoPlayer[playerid] = 1;
SendClientMessage(playerid,VERDE,"[AVISO]: Parabйns Vocк esta de Cinto, Agora Esta Protegido (/tirarcinto)");
SetPlayerWantedLevel(playerid, 0);
return 1;
}
if(!strcmp(cmdtext, "/tirarcinto", true))
{
if(!IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid,0x00FF00AA,"Vocк nгo esta em um Carro");
if(CintoPlayer[playerid]==0) return SendClientMessage(playerid,0x00FF00AA,"Vocк nгo esta de Cinto");
CintoPlayer[playerid] = 0;
SendClientMessage(playerid,AMARELO,"[AVISO]: Cuidado Vocк Esta Sem Cinto, Pode Morrer (/cinto)");
SetPlayerWantedLevel(playerid, 0);
}
return 1;
}
if(strcmp(cmdtext, "/ligarv", true) == 0)
{
if(Engine[vehicleid] == 0)
{
SendClientMessage(playerid, VERDE, "Ligando veiculo...");
SetTimerEx("EngineTimer", 2000, 0, "i", playerid);
}
else if(Engine[vehicleid] == 1)
{
SendClientMessage(playerid, AMARELO, "Seu veiculo ja estб ligado!.");
}
return 1;
}
if(strcmp(cmdtext, "/desligarv", true) == 0)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(Engine[vehicleid] == 1)
{
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, VERMELHO, "Saia do veiculo digitando /sairv.");
Engine[vehicleid] = 0;
TogglePlayerControllable(playerid, 0);
}
else
{
SendClientMessage(playerid, VERMELHO, "Vocк nгo estб em um veiculo.");
}
}
return 1;
}
if(strcmp(cmd, "/sairv", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
}
return 1;
}
if(strcmp(cmdtext, "/freio", true) == 0)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(Engine[vehicleid] == 1)
{
if(Freio[vehicleid] == 0)
{
SendClientMessage(playerid, VERMELHO, "Quando quizer por o freio de mгo, use /freio novamente");
Freio[vehicleid] = 1;
TogglePlayerControllable(playerid,1);
}
else if(Freio[vehicleid] == 1)
{
SendClientMessage(playerid, VERMELHO, "Saia do veiculo apertando (Enter), (F) ou digitando /sair.");
SendClientMessage(playerid, VERDE, "Quando quizer tirar o freio de mгo, use /freio novamente");
Freio[vehicleid] = 0;
TogglePlayerControllable(playerid,0);
}
}
else
{
SendClientMessage(playerid, VERMELHO, "Ligue o veiculo antes de mexer no freio de mгo!.");
}
return 1;
}
return 0;
}
Re: [URGENTE]Ajuda -
rene20 - 04.10.2010
Continuo o mesmo poblema
Re: [URGENTE]Ajuda -
zSuYaNw - 04.10.2010
Quote:
Originally Posted by rene20
Continuo o mesmo poblema
|
qual й os erros ?
Re: [URGENTE]Ajuda -
rene20 - 05.10.2010
POOOO
Erro no compiler cara
Re: [URGENTE]Ajuda -
Gustavob - 05.10.2010
qual erro que dб
nгo onde
EDIT
acho que achei uma chave a mais usando Notepad++
tenta
pawn Код:
//---------------------------<[ OnPlayerCommandText ]>--------------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[256];
new playerdinheiro;
new giveplayer[MAX_PLAYER_NAME];
new playername[MAX_PLAYER_NAME];
new cmd[256];
new tmp[256];
new vehicleid = GetPlayerVehicleID(playerid);
new giveplayerid, moneys, idx;
cmd = strtok(cmdtext, idx);
/* CREEEEEEEEEEEEEEEEEEEEEUUUUUUUUUUUUUUUUUU */
if(strcmp(cmd, "/creu", true) == 0 || strcmp(cmd, "/crйu", true) == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s estб danзando o Crйu.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ApplyAnimation(playerid,"CHOPPA","CHOPPA_back",4.1,1,1,1,1,1);
SendClientMessage(playerid, COLOR_DBLUE, "ЙЙЙЙ Creeeeeeu!");
return 1;
}
if(strcmp(cmd, "/cvip", true) == 0 || strcmp(cmd, "/chatvip", true) == 0)
{
if(IsPlayerConnected(playerid) && PlayerInfo[playerid][pVIP] >= 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USO: /cvip [Chat Vip]");
return 1;
}
format(string, sizeof(string), "** VIP %s: %s", sendername, result);
SendVIPMessage(0xFFCCFFAA,string);
printf("VIP %s: %s", sendername, result);
}
return 1;
}
if (strcmp(cmd, "/infodacasa", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (gPlayerLogged[playerid] != 0)
{
InfoDaCasa();
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s olha as info da casa.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Voce nao esta logado !");
}
}
return 1;
}
if(!strcmp(cmdtext, "/cinto", true))
{
if(CintoPlayer[playerid]==1) return SendClientMessage(playerid,0x00FF00AA,"Vocк ja esta de Cinto");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0x00FF00AA,"Vocк nгo esta em um Carro");
CintoPlayer[playerid] = 1;
SendClientMessage(playerid,VERDE,"[AVISO]: Parabйns Vocк esta de Cinto, Agora Esta Protegido (/tirarcinto)");
SetPlayerWantedLevel(playerid, 0);
return 1;
}
if(!strcmp(cmdtext, "/tirarcinto", true))
{
if(!IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid,0x00FF00AA,"Vocк nгo esta em um Carro");
if(CintoPlayer[playerid]==0) return SendClientMessage(playerid,0x00FF00AA,"Vocк nгo esta de Cinto");
CintoPlayer[playerid] = 0;
SendClientMessage(playerid,AMARELO,"[AVISO]: Cuidado Vocк Esta Sem Cinto, Pode Morrer (/cinto)");
SetPlayerWantedLevel(playerid, 0);
}
return 1;
if(strcmp(cmdtext, "/ligarv", true) == 0)
{
if(Engine[vehicleid] == 0)
{
SendClientMessage(playerid, VERDE, "Ligando veiculo...");
SetTimerEx("EngineTimer", 2000, 0, "i", playerid);
}
else if(Engine[vehicleid] == 1)
{
SendClientMessage(playerid, AMARELO, "Seu veiculo ja estб ligado!.");
}
return 1;
}
if(strcmp(cmdtext, "/desligarv", true) == 0)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(Engine[vehicleid] == 1)
{
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, VERMELHO, "Saia do veiculo digitando /sairv.");
Engine[vehicleid] = 0;
TogglePlayerControllable(playerid, 0);
}
else
{
SendClientMessage(playerid, VERMELHO, "Vocк nгo estб em um veiculo.");
}
}
return 1;
}
if(strcmp(cmd, "/sairv", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
}
return 1;
}
if(strcmp(cmdtext, "/freio", true) == 0)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(Engine[vehicleid] == 1)
{
if(Freio[vehicleid] == 0)
{
SendClientMessage(playerid, VERMELHO, "Quando quizer por o freio de mгo, use /freio novamente");
Freio[vehicleid] = 1;
TogglePlayerControllable(playerid,1);
}
else if(Freio[vehicleid] == 1)
{
SendClientMessage(playerid, VERMELHO, "Saia do veiculo apertando (Enter), (F) ou digitando /sair.");
SendClientMessage(playerid, VERDE, "Quando quizer tirar o freio de mгo, use /freio novamente");
Freio[vehicleid] = 0;
TogglePlayerControllable(playerid,0);
}
}
else
{
SendClientMessage(playerid, VERMELHO, "Ligue o veiculo antes de mexer no freio de mгo!.");
}
return 1;
}
return 0;
}
Re: [URGENTE]Ajuda -
rene20 - 05.10.2010
Porra !
da erro no compiler nao compila
por causa das chaves
entendeu
??
Re: [URGENTE]Ajuda -
Gustavob - 05.10.2010
sim mas tem muitos erros, mas /esqueceaquilo
olha meu edit