Jump to content
  • 0

Question

Posted

Am un FS Vote System, dar cand dau /vote "Cine e cel mai tare?" (exemplu...)    pur si simplu Nu Apare Votul... :( Imi puteti spune ce este gresit? Multumesc.

Pawno(FS):

[pawn]#include <a_samp>

//==============================================================================

#define LARANJA 0xFF6600AA

#define VERDECLARO 0x00FF0CAA

#define VERDEMEDIO          0xa5b1A3AA

#define BRANCO              0xFFFFFFAA

#define VERMELHO            0xFF0000AA

#define VERDEFRACO        0x80cf80AA

//==============================================================================

enum e_votacao

{

bool:iniciada,

sim,

nao,

total

}

new votacao[e_votacao];

new votou[MAX_PLAYERS];

//==============================================================================

public OnFilterScriptInit()

{

print("===================================");

print("==>>  Filter Script of Vote!  <<==");

print("==>>    Created by  Me      <<==");

print("==>>  Version RO 0.1 BETA    <<==");

print("===================================");

return 1;

}

//==============================================================================

public OnPlayerCommandText(playerid, cmdtext[])

{

new string[256];

if(!strcmp(cmdtext, "/vot", true,5))

{

if (!IsPlayerAdmin(playerid))

{

if(!votacao[iniciada])

{

if(!strlen(cmdtext[6]))

return SendClientMessage(playerid,0xFFFFFFAA, "Usage: /vot [intrebare]");

SendClientMessageToAll(LARANJA,"====================================");

format(string, sizeof string, "==> New Vote: %s?", cmdtext[6]);

SendClientMessageToAll(VERDECLARO, string);

SendClientMessageToAll(LARANJA," ");

SendClientMessageToAll(LARANJA," > Pentru a vota foloseste:");

SendClientMessageToAll(VERDEMEDIO, "> /da - Daca esti de acord.");

SendClientMessageToAll(VERDEMEDIO, "> /nu - Daca nu esti de acord.");

SendClientMessageToAll(LARANJA,"====================================");

votacao[iniciada] = true;

votacao[sim] = 0;

votacao[nao] = 0;

GameTextForAll("~w~Noul ~r~vot~w~ a fost~b~ creat!",6000,3);

for(new i; i <MAX_PLAYERS; i++)

{

votou = false;

}

}

else

{

SendClientMessage(playerid,BRANCO,"Este deja un vot in desfasurare!");

}

}

else

{

SendClientMessage(playerid,BRANCO,"Nu ai acces la aceasta comanda!");

}

return 1;

}

if(!strcmp(cmdtext, "/da", true))

{

if(votacao[iniciada] && !votou[playerid])

{

SendClientMessage(playerid,LARANJA, "Votul tau a fost inregistrat! [DA]");

votacao[sim]++;

votacao[total]++;

votou[playerid] = true;

return 1;

}

return 0;

}

if(!strcmp(cmdtext, "/nu", true))

{

if(votacao[iniciada] && !votou[playerid])

{

SendClientMessage(playerid,LARANJA, "Votul tau a fost inregistrat! [NU]");

votacao[nao]++;

votacao[total]++;

votou[playerid] = true;

return 1;

}

return 0;

}

if(!strcmp(cmdtext, "/end", true))

{

if (IsPlayerAdmin(playerid))

{

if(votacao[iniciada])

{

SendClientMessageToAll(LARANJA,"====================================");

SendClientMessageToAll(LARANJA, "==> Vot inchis! <<==");

format(string, sizeof string, "> %d jucatori au fost de acord.", votacao[sim]);

SendClientMessageToAll(VERDEMEDIO,string);

format(string, sizeof string, "> %d jucatori nu au fost de acord.", votacao[nao]);

SendClientMessageToAll(VERDEMEDIO, string);

format(string, sizeof string, "> Aces vot a adunat %d de voturi.",votacao[total]);

SendClientMessageToAll(BRANCO, string);

if(votacao[sim] == votacao[nao])

{

SendClientMessageToAll(VERMELHO, "==> A fost egalitate!");

} else if(votacao[sim] > votacao[nao])

{

SendClientMessageToAll(VERMELHO, "==> Cei mai multi au fost de acord. [NU]");

} else if(votacao[sim] < votacao[nao])

{

SendClientMessageToAll(VERMELHO, "==> Cei mai multi nu au fost de acord. [DA]");

}

SendClientMessageToAll(LARANJA,"====================================");

GameTextForAll("~r~A Votul~w~ s-a~r~ ~b~terminat!",6000,3);

votacao[iniciada] = false;

votacao[sim] = 0;

votacao[nao] = 0;

votacao[total] = 0;

for(new i; i <MAX_PLAYERS; i++)

{

votou = false;

}

}

else

{

SendClientMessage(playerid,BRANCO, "Nici un vot nu a fost pornit!");

}

}

else

{

SendClientMessage(playerid,BRANCO, "Nu ai acces la aceasta comanda!");

}

return 1;

}

return 0;

}[/pawn]

17 answers to this question

Recommended Posts

Posted

Zimi clar ce patesti, iti apare ceva?

ia pune comanda asa

if(strcmp("/vot", cmdtext, true) == 0)

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Posted

Deci, cand scriu /vot apare: USAGE: /vot [text]

Apoi daca dau sa zicem /vot Cine e cel mai tare?    Numai apare nimic!

Posted

Dar as vrea sa mi-l faci pe asta te rog...

Uite-te parca e ceva in neregula la sendmessagetoall acolo, parca nu are logica uite-te cu atentie te rog pe la

if(!strlen(cmdtext[6]))

return SendClientMessage(playerid,0xFFFFFFAA, "Usage: /vot [intrebare]");

SendClientMessageToAll(LARANJA,"====================================");

format(string, sizeof string, "==> New Vote: %s?", cmdtext[6]);

SendClientMessageToAll(VERDECLARO, string);

Posted

Uite aici filescriptul(este ultimul care til repar asa, cred ca vei postat tot gamemodul pe bucati pana la urma)

ntg.png

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Posted

Uite ce scrie aici if(IsPlayerAdmin(playerid)). Sa iti traduc "Daca esti connectat cu RCON-ul vei putea folosi comanda".

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.