24.06.2013, 21:19
criador de portхes conheзo esse: https://sampforum.blast.hk/showthread.php?tid=418207
sobre o posto,
Juntos as demais Publics
Aqui coloque no topo do GM para definir, o mesmo para o new
Este й o comando, se jб tem ignore esta parte
Se vocк jб tem sistema de combustivel, sу colocar todas as etapas normalmente que nada vai dar errado.
Caso nгo tenho um sistema de combustнvel, sу postar irei te passar o meu, espero ter ajudado.
Atenciosamente,
sobre o posto,
Juntos as demais Publics
pawn Код:
public locais()
for (new i=0;i<MAX_PLAYERS;i++){
if(IsPlayerConnected(i)){
if (PlayerToPoint(7.0, i, X,Y,Z)){//coloque aqui suas corndedas.
GameTextForPlayer(i,"~h~~w~Posto ~y~Ipiranga~n~Digite~r~/abastecer",3000,4);
AreaPosto[i] = 1;
} else {
if(AreaPosto[i] == 1){
AreaPosto[i] = 0;
}
}
}
}
}
}
}
}
pawn Код:
new AreaPosto[MAX_PLAYERS];
forward locais();
pawn Код:
if(strcmp(cmd, "/abastecer", true) == 0) {
new tmp[256];
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
new quantidade;
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, Vermelho, "(ERRO) Uso: /abastecer [litros]");
return 1;
}
quantidade = strval(tmp);
if(quantidade <= 0 || GetPlayerGrana(playerid) < quantidade){
SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo tem dinheiro suficiente para pagar o frentista.");
return 1;
}
if(AreaPosto[playerid] == 1){
if(quantidade + dini_Int(file, "Combustivel") < 100){
dini_IntSet(file, "Combustivel", dini_Int(file, "Combustivel") + quantidade);
format(string, sizeof(string), "(INFO) Vocк completou seu tanque com %d litros de combustнvel.", quantidade);
SendClientMessage(playerid, COLOR_GREEN, string);
GivePlayerGrana(playerid, - quantidade);
return 1;
}
if(quantidade + dini_Int(file, "Combustivel")){
new quantia;
quantia = 100 - dini_Int(file, "Combustivel");
dini_IntSet(file, "Combustivel", 100);
format(string, sizeof(string), "(INFO) Pronto tanque cheio foram colocados %d litros.", quantia);
SendClientMessage(playerid, COLOR_GREEN, string);
GivePlayerGrana(playerid, - quantia);
return 1;
}
}else{
SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo estб no posto.");
return 1;
}
}
Caso nгo tenho um sistema de combustнvel, sу postar irei te passar o meu, espero ter ajudado.
Atenciosamente,