SA-MP Forums Archive
[Ajuda] Player nгo recebe grana - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Player nгo recebe grana (/showthread.php?tid=406186)



Player nгo recebe grana - WotusPower - 09.01.2013

Tenho um comando /descarregarm [ minerio ], mas quando o player descarrega, ele ganha os 2000 reais, mas o dinheiro que ele ganha й zerado.
CMD:
pawn Код:
if(strcmp(cmd,"/descarregarm", true) == 0) {
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 515 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 450) return SendClientMessage(playerid, 0xFF0000, "Vocк nгo estб em um veнculo adequado!");

    if(IsPlayerInRangeOfPoint(playerid, 5.0, 2632.691650, 850.259277, 6.093750)) {

        GivePlayerGrana(playerid, 2000);
        SendClientMessage(playerid, -1, "Descarregado com sucesso! + 2000");
    }
    else {
        SendClientMessage(playerid, -1, "[ERRO] Vocк nгo estб no local de descarga !!!");
    }
    return true;
}
O Player nгo recebe a grana.

Comando /dargrana de admin
pawn Код:
if(strcmp(cmd,"/dargrana", true)==0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), P_CONTAS, aname);
if(pAdmin[playerid] == 5){
new tmp[256];
new plid, grana;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, Vermelho, "Digite: /dargrana [id] [grana]");
return 1;
}
plid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "Digite: /dargrana [id] [grana]");
return 1;
}
grana = strval(tmp);
if(IsPlayerConnected(plid)){
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "{0099FF}(~){CCCCFF} %s(ID: %d) vocк deu para %s $%d de grana.", aname, playerid, pname, grana);
SendClientMessage(playerid, AzuL4, string);
format(string, sizeof(string), "{0099FF}(~){CCCCFF} O Adm %s deu para vocк $%d de Grana.", aname, playerid, grana);
SendClientMessage(plid, outraadm, string);
GivePlayerGrana(plid,grana);
return 1;
}else{
SendClientMessage(playerid, Vermelho, "{0099FF}(~){CCCCFF} Jogador nгo conectado.");
return 1;
}
}
}
+REP


Re: [AJUDA] Player nгo recebe grana - Nice-.- - 09.01.2013

GivePlayerGrana(playerid, 2000);?
GivePlayerMoney(playerid, 2000);


Re: [AJUDA] Player nгo recebe grana - WotusPower - 09.01.2013

@RESOLVIDO

tenho mais uma duvida, eu quero que o player tenque ter o comando /carregarm, para poder descarregar.
E O comando /carregarm tenque estar no checkpoint.
A coordenada do checkpoint eu arrumo, sу deixar entre ()

+REP


AW: [AJUDA] Player nгo recebe grana - DiiMeNoR - 09.01.2013

¬¬'

https://sampwiki.blast.hk/


Re: [AJUDA] Player nгo recebe grana - Nice-.- - 09.01.2013

Quote:
Originally Posted by WotusPower
Посмотреть сообщение
@RESOLVIDO

tenho mais uma duvida, eu quero que o player tenque ter o comando /carregarm, para poder descarregar.
E O comando /carregarm tenque estar no checkpoint.
A coordenada do checkpoint eu arrumo, sу deixar entre ()

+REP
nгo intendi direito mais acho que й isso

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint


Re: [AJUDA] Player nгo recebe grana - WotusPower - 09.01.2013

Como eu vo fazer para que o /descarregarm cheque que o player usou /carregarp NO LOCAL CERTO?


Re: [AJUDA] Player nгo recebe grana - Linow - 09.01.2013

https://sampwiki.blast.hk/wiki/OnPlayerEnterCheckpoint
https://sampwiki.blast.hk/wiki/IsPlayerInCheckpoint

Isso basta.

@EDIT:
Pra vocк checar se ele carregou no lugar certo tenta isso:

Quando ele carregar adiciona:
pawn Код:
SetPVarInt(playerid, "CarregouMinerio", 1);
Para verificar se ele carregou na hora de descarregar:
pawn Код:
if(GetPVarInt(playerid, "CarregouMinerio") == 1)
{
     // Carregado
}
else
{
     // Nгo carregou
     SendClientMessage(playerid, -1, "Vocк nгo carregou os minйrios, logo nгo poderб descarregar.");
}



Re: [AJUDA] Player nгo recebe grana - WotusPower - 09.01.2013

Basta nгo.
Nгo entendo nada de pwn.
Nгo sei absolutamente nd como formar os codigos.

@Ainda ta valendo REP QEM ajudar


Re: [AJUDA] Player nгo recebe grana - Nice-.- - 09.01.2013

Quote:
Originally Posted by WotusPower
Посмотреть сообщение
Basta nгo.
Nгo entendo nada de pwn.
Nгo sei absolutamente nd como formar os codigos.

@Ainda ta valendo REP QEM ajudar
estuda ninguem vai te dar codigo pronto por isso й a TAG [ajuda]

e outra

vc nгo pode dar REP sу 50 post's mais


Re: Player nгo recebe grana - Maklister - 09.01.2013

Caso vocк use a include cpstream

pawn Код:
cpname = CPS_GetPlayerCheckpoint(playerid);
if(cpname = CPDescarregar)
{
    // se ele tiver no Cp
}
else
{
    // Se ele NГO tiver no Cp
}
Ou

OnPlayerEnterCheckpoint