[AJUDA]Erros no codigo -
wevertonneves - 17.11.2011
entao ja tentei de todos os jeito tentar fazerr uma org com os tutoriais do Josma(se eu nao me engano)
sempre da erro olhem ai
PHP код:
if(strcmp(cmd,"/convidarr", true)==0)
{
tmp = strtok(cmdtext, idx);
new PlayerB;
if(!strlen(tmp)) return SendClientMessage(playerid, Branco,"uso correto:/convidar [ID]");
PlayerB = strval(tmp);
if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco,"Jogador nao conectado");
if(PlayerInfo [playerid] [PMilitar] >= 6)
{
PlayerInfo[PlayerB] [PMilitar] = 1;
SendClientMessage(PlayerB, Branco,"Voce entrou na Policia militar");
SetPlayerColor(PlayerB, Cor_PMilitar);
return 1;
}
else if(PlayerInfo[playerid][Groove] >=6)
{
PlayerInfo[PlayerB][Groove] = 1;
SendClientMessage(PlayerB,Branco,"Voce entrou para groove");
SetPlayerColor(PlayerB, Cor_Grove);
return 1;
}
else if(PlayerInfo[playerid][Ballas] >=6)
{
PlayerInfo[PlayerB][Ballas] = 1;
SendClientMessage(PlayerB,Branco,"Voce entrou nos Ballas");
SetPlayerColor(PlayerB, Cor_Ballas);
return 1;
}
return 1;
}
if(strcmp(cmd, "/promoverr", true) == 0)
{
tmp = strtok(cmdtext, idx);
new PlayerB, level;
if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /promover [id] [cargo]");
PlayerB = strval(tmp);
if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /promover [id] [cargo]");
level = strval(tmp);
if(level < 1 || level > 6) return SendClientMessage(playerid, Branco, "O level deve ser maior que 0 e menor que 7");
new string[128], promovedor[MAX_PLAYER_NAME];
GetPlayerName(playerid, promovedor, sizeof(promovedor));
if(PlayerInfo[playerid][PMilitar] >= 6)
{
if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
PlayerInfo[PlayerB][PMilitar] = level;
format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor););
SendClientMessage(PlayerB, Branco, string);
return 1;
}
else if(PlayerInfo[playerid][Groove] >= 6)
{
if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
PlayerInfo[PlayerB][Groove] = level;
format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor););
SendClientMessage(PlayerB, Branco, string);
return 1;
}
else if(PlayerInfo[playerid][Ballas] >= 6)
{
if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
PlayerInfo[PlayerB][Ballas] = level;
format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor););
SendClientMessage(PlayerB, Branco, string);
return 1;
}
return 1;
}
if(strcmp(cmd, "/demitirr", true) == 0)
{
tmp = strtok(cmdtext, idx);
new PlayerB, string[128], demitidor[MAX_PLAYER_NAME];
if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /demitir [id]");
PlayerB = strval(tmp);
GetPlayerName(playerid, demitidor, sizeof(demitidor));
if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
if(PlayerInfo[playerid][PMilitar] >= 6)
{
if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
PlayerInfo[PlayerB][PMilitar] = 0;
format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
SendClientMessage(PlayerB, Branco, string);
return 1;
}
else if(PlayerInfo[playerid][Groove] >= 6)
{
if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
PlayerInfo[PlayerB][Groove] = 0;
format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
SendClientMessage(PlayerB, Branco, string);
return 1;
}
else if(PlayerInfo[playerid][Ballas] >= 6)
{
if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
PlayerInfo[PlayerB][Ballas] = 0;
format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
SendClientMessage(PlayerB, Branco, string);
return 1;
}
return 1;
}
(115) : warning: 217: loose indentation
(115) : warning: 217: loose indentation
: error: 017: undefined symbol "Branco"
(115) : error: 017: undefined symbol "Branco"
mecanicos.pwn(115) : error: 017: undefined symbol "PlayerInfo"
mecanicos.pwn(115) : warning: 215: expression has no effect
mecanicos.pwn(115) : error: 001: expected token: ";", but found "]"
mecanicos.pwn(115) : error: 029: invalid expressio
mecanicos.pwn(115) : error: 029: invalid expression, assumed zero
\mecanicos.pwn(115) : error fatal: 107: too many error messages on one line[/PHP]
Re: [AJUDA]Erros no codigo -
Pharrel - 17.11.2011
Primeiro erro clique aqui
2є erro:
pawn Код:
//poe no topo do GM
#define Branco 0xFFFFFFFF
3є erro vc tem que criar a variavel PlayerInfo ou uma outra variavel de sua preferencia.
Re: [AJUDA]Erros no codigo -
Kostas' - 17.11.2011
Line 115?
pawn Код:
#define Branco 0xFFFFFFFF
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd,"/convidarr", true)==0) {
tmp = strtok(cmdtext, idx);
new PlayerB;
if(!strlen(tmp)) return SendClientMessage(playerid, Branco,"uso correto:/convidar [ID]");
PlayerB = strval(tmp);
if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco,"Jogador nao conectado");
if(PlayerInfo [playerid] [PMilitar] >= 6) {
PlayerInfo[PlayerB] [PMilitar] = 1;
SendClientMessage(PlayerB, Branco,"Voce entrou na Policia militar");
SetPlayerColor(PlayerB, Cor_PMilitar);
return 1;
}
else if(PlayerInfo[playerid][Groove] >=6) {
PlayerInfo[PlayerB][Groove] = 1;
SendClientMessage(PlayerB,Branco,"Voce entrou para groove");
SetPlayerColor(PlayerB, Cor_Grove);
return 1;
}
else if(PlayerInfo[playerid][Ballas] >=6) {
PlayerInfo[PlayerB][Ballas] = 1;
SendClientMessage(PlayerB,Branco,"Voce entrou nos Ballas");
SetPlayerColor(PlayerB, Cor_Ballas);
return 1;
}
return 1;
}
if(strcmp(cmd, "/promoverr", true) == 0) {
tmp = strtok(cmdtext, idx);
new PlayerB, level;
if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /promover [id] [cargo]");
PlayerB = strval(tmp);
if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /promover [id] [cargo]");
level = strval(tmp);
if(level < 1 || level > 6) return SendClientMessage(playerid, Branco, "O level deve ser maior que 0 e menor que 7");
new string[128], promovedor[MAX_PLAYER_NAME];
GetPlayerName(playerid, promovedor, sizeof(promovedor));
if(PlayerInfo[playerid][PMilitar] >= 6) {
if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
PlayerInfo[PlayerB][PMilitar] = level;
format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor););
SendClientMessage(PlayerB, Branco, string);
return 1;
}
else if(PlayerInfo[playerid][Groove] >= 6) {
if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
PlayerInfo[PlayerB][Groove] = level;
format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor););
SendClientMessage(PlayerB, Branco, string);
return 1;
}
else if(PlayerInfo[playerid][Ballas] >= 6) {
if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
PlayerInfo[PlayerB][Ballas] = level;
format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor););
SendClientMessage(PlayerB, Branco, string);
return 1;
}
return 1;
}
if(strcmp(cmd, "/demitirr", true) == 0) {
tmp = strtok(cmdtext, idx);
new PlayerB, string[128], demitidor[MAX_PLAYER_NAME];
if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /demitir [id]");
PlayerB = strval(tmp);
GetPlayerName(playerid, demitidor, sizeof(demitidor));
if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
if(PlayerInfo[playerid][PMilitar] >= 6) {
if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
PlayerInfo[PlayerB][PMilitar] = 0;
format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
SendClientMessage(PlayerB, Branco, string);
return 1;
}
else if(PlayerInfo[playerid][Groove] >= 6) {
if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
PlayerInfo[PlayerB][Groove] = 0;
format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
SendClientMessage(PlayerB, Branco, string);
return 1;
}
else if(PlayerInfo[playerid][Ballas] >= 6) {
if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
PlayerInfo[PlayerB][Ballas] = 0;
format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
SendClientMessage(PlayerB, Branco, string);
return 1;
}
return 1;
}
// Rest of Code Here
Re: [AJUDA]Erros no codigo -
wevertonneves - 17.11.2011
Ai todo o codigo quem me ajudar vou dar reputation
Код:
#include <a_samp>
#if defined FILTERSCRIPT
enum Info
{
PMilitar,
Groove,
Ballas
};
#define Branco 0xFFFFFFAA
new PlayerInfo[MAX_PLAYERS] [Info];
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128];
new tmp[128],idx;
cmd = strtok(cmdtext, idx);
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
if(strcmp(cmd,"/convidarr", true)==0)
{
tmp = strtok(cmdtext, idx);
new PlayerB;
if(!strlen(tmp)) return SendClientMessage(playerid, Branco,"uso correto:/convidar [ID]");
PlayerB = strval(tmp);
if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco,"Jogador nao conectado");
if(PlayerInfo[playerid] [PMilitar] >= 6)
{
PlayerInfo[PlayerB] [PMilitar] = 1;
SendClientMessage(PlayerB, Branco,"Voce entrou na Policia militar");
SetPlayerColor(PlayerB, Cor_PMilitar);
return 1;
}
else if(PlayerInfo[playerid][Groove] >=6)
{
PlayerInfo[PlayerB][Groove] = 1;
SendClientMessage(PlayerB,Branco,"Voce entrou para groove");
SetPlayerColor(PlayerB, Cor_Grove);
return 1;
}
else if(PlayerInfo[playerid][Ballas] >=6)
{
PlayerInfo[PlayerB][Ballas] = 1;
SendClientMessage(PlayerB,Branco,"Voce entrou nos Ballas");
SetPlayerColor(PlayerB, Cor_Ballas);
return 1;
}
return 1;
}
if(strcmp(cmd, "/promoverr", true) == 0)
{
tmp = strtok(cmdtext, idx);
new PlayerB, level;
if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /promover [id] [cargo]");
PlayerB = strval(tmp);
if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /promover [id] [cargo]");
level = strval(tmp);
if(level < 1 || level > 6) return SendClientMessage(playerid, Branco, "O level deve ser maior que 0 e menor que 7");
new string[128], promovedor[MAX_PLAYER_NAME];
GetPlayerName(playerid, promovedor, sizeof(promovedor));
if(PlayerInfo[playerid][PMilitar] >= 6)
{
if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
PlayerInfo[PlayerB][PMilitar] = level;
format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor););
SendClientMessage(PlayerB, Branco, string);
return 1;
}
else if(PlayerInfo[playerid][Groove] >= 6)
{
if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
PlayerInfo[PlayerB][Groove] = level;
format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor););
SendClientMessage(PlayerB, Branco, string);
return 1;
}
else if(PlayerInfo[playerid][Ballas] >= 6)
{
if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
PlayerInfo[PlayerB][Ballas] = level;
format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor););
SendClientMessage(PlayerB, Branco, string);
return 1;
}
return 1;
}
if(strcmp(cmd, "/demitirr", true) == 0)
{
tmp = strtok(cmdtext, idx);
new PlayerB, string[128], demitidor[MAX_PLAYER_NAME];
if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /demitir [id]");
PlayerB = strval(tmp);
GetPlayerName(playerid, demitidor, sizeof(demitidor));
if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
if(PlayerInfo[playerid][PMilitar] >= 6)
{
if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
PlayerInfo[PlayerB][PMilitar] = 0;
format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
SendClientMessage(PlayerB, Branco, string);
return 1;
}
else if(PlayerInfo[playerid][Groove] >= 6)
{
if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
PlayerInfo[PlayerB][Groove] = 0;
format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
SendClientMessage(PlayerB, Branco, string);
return 1;
}
else if(PlayerInfo[playerid][Ballas] >= 6)
{
if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
PlayerInfo[PlayerB][Ballas] = 0;
format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
SendClientMessage(PlayerB, Branco, string);
return 1;
}
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
forward SalvarOrg(playeri);
public SalvarOrg(playerid)
{
new arquivo[60], nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, nome, sizeof(nome));
format(arquivo, sizeof(arquivo), "Contas\%s.ini", nome);
if(!dini_Exists(arquivo))
{
dini_Create(arquivo);
}
if(PlayerInfo[playerid][PMilitar] > 0) dini_IntSet(arquivo, "PMilitar", PlayerInfo[playerid][PMilitar]);
if(PlayerInfo[playerid][Groove] > 0) dini_IntSet(arquivo, "Groove", PlayerInfo[playerid][Groove]);
if(PlayerInfo[playerid][Ballas] > 0) dini_IntSet(arquivo, "Ballas", PlayerInfo[playerid][Ballas]);
return 1;
}
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
index++;
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
Re: [AJUDA]Erros no codigo -
Pharrel - 17.11.2011
pawn Код:
#include <a_samp>
#include <Dini>
#define Branco 0xFFFFFFFF
#define Cor_PMilitar 0x0000FFFF
#define Cor_Grove 0x008000FF
#define Cor_Ballas 0x800080FF
enum Info
{
PMilitar,
Groove,
Ballas
}
new PlayerInfo[MAX_PLAYERS][Info];
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128];
new tmp[128],idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd,"/convidarr", true)==0)
{
tmp = strtok(cmdtext, idx);
new PlayerB;
if(!strlen(tmp)) return SendClientMessage(playerid, 0xFFFFFFFF,"uso correto:/convidar [ID]");
PlayerB = strval(tmp);
if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, 0xFFFFFFFF,"Jogador nao conectado");
if(PlayerInfo[playerid] [PMilitar] >= 6)
{
PlayerInfo[PlayerB] [PMilitar] = 1;
SendClientMessage(PlayerB, Branco,"Voce entrou na Policia militar");
SetPlayerColor(PlayerB, Cor_PMilitar);
return 1;
}
else if(PlayerInfo[playerid][Groove] >=6)
{
PlayerInfo[PlayerB][Groove] = 1;
SendClientMessage(PlayerB,Branco,"Voce entrou para groove");
SetPlayerColor(PlayerB, Cor_Grove);
return 1;
}
else if(PlayerInfo[playerid][Ballas] >=6)
{
PlayerInfo[PlayerB][Ballas] = 1;
SendClientMessage(PlayerB,Branco,"Voce entrou nos Ballas");
SetPlayerColor(PlayerB, Cor_Ballas);
return 1;
}
return 1;
}
if(strcmp(cmd, "/promoverr", true) == 0)
{
tmp = strtok(cmdtext, idx);
new PlayerB, level;
if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /promover [id] [cargo]");
PlayerB = strval(tmp);
if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /promover [id] [cargo]");
level = strval(tmp);
if(level < 1 || level > 6) return SendClientMessage(playerid, Branco, "O level deve ser maior que 0 e menor que 7");
new string[128], promovedor[MAX_PLAYER_NAME];
GetPlayerName(playerid, promovedor, sizeof(promovedor));
if(PlayerInfo[playerid][PMilitar] >= 6)
{
if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
PlayerInfo[PlayerB][PMilitar] = level;
format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor);
SendClientMessage(PlayerB, Branco, string);
return 1;
}
else if(PlayerInfo[playerid][Groove] >= 6)
{
if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
PlayerInfo[PlayerB][Groove] = level;
format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor);
SendClientMessage(PlayerB, Branco, string);
return 1;
}
else if(PlayerInfo[playerid][Ballas] >= 6)
{
if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
PlayerInfo[PlayerB][Ballas] = level;
format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor);
SendClientMessage(PlayerB, Branco, string);
return 1;
}
return 1;
}
if(strcmp(cmd, "/demitirr", true) == 0)
{
tmp = strtok(cmdtext, idx);
new PlayerB, string[128], demitidor[MAX_PLAYER_NAME];
if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /demitir [id]");
PlayerB = strval(tmp);
GetPlayerName(playerid, demitidor, sizeof(demitidor));
if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
if(PlayerInfo[playerid][PMilitar] >= 6)
{
if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
PlayerInfo[PlayerB][PMilitar] = 0;
format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
SendClientMessage(PlayerB, Branco, string);
return 1;
}
else if(PlayerInfo[playerid][Groove] >= 6)
{
if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
PlayerInfo[PlayerB][Groove] = 0;
format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
SendClientMessage(PlayerB, Branco, string);
return 1;
}
else if(PlayerInfo[playerid][Ballas] >= 6)
{
if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
PlayerInfo[PlayerB][Ballas] = 0;
format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
SendClientMessage(PlayerB, Branco, string);
return 1;
}
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
forward SalvarOrg(playerid);
public SalvarOrg(playerid)
{
new arquivo[60], nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, nome, sizeof(nome));
format(arquivo, sizeof(arquivo), "Contas\%s.ini", nome);
if(!dini_Exists(arquivo))
{
dini_Create(arquivo);
}
if(PlayerInfo[playerid][PMilitar] > 0) dini_IntSet(arquivo, "PMilitar", PlayerInfo[playerid][PMilitar]);
if(PlayerInfo[playerid][Groove] > 0) dini_IntSet(arquivo, "Groove", PlayerInfo[playerid][Groove]);
if(PlayerInfo[playerid][Ballas] > 0) dini_IntSet(arquivo, "Ballas", PlayerInfo[playerid][Ballas]);
return 1;
}
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
index++;
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
Re: [AJUDA]Erros no codigo -
wevertonneves - 17.11.2011
Vlw Muito Obrigado amanha colocarei mais 1 de reputacion para voce hoje ue ja coloquei