11.06.2012, 01:45
Olб a todos eu sou Hades (Ades) , vim postar meu primeiro projeto relacionado a linguagem PAWN , й um FilterScript Simples pois ainda estou aprendendo pawn .
ScreenShot's
Comando/Detalhes
/carma - Seleciona e compra arma .
Opзхes de armas :
1-Desert Eagle
2-Granadas
3-Sawn-Off Shotgun
4-Molotov
5-Lanзador de Misseis
6-AK47
7-M4
Caso Vocк Queira Mas armas й somente adicionar no Filter Script
Download :
pawn Код:
#define FILTERSCRIPT
#include <a_samp>
#if defined FILTERSCRIPT
new iArmaatual[MAX_PLAYERS];
new listitems[] = "1\tDesert Eagle\n2\tGranadas\n3\tSawn-Off Shotgun\n4\tMolotov\n5\tLanзador de Misseis7\n6\tAK47\n7\tM4\n";
//
forward OnPlayerChangeWeapon(playerid, oldweapon, newweapon);
public OnFilterScriptInit()
{
print("\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
print(" Seletor de Armas ");
print(" by Hades ");
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
print(" Finalizando FilterScript ");
print(" Seletor de Armas ");
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
}
#endif
public OnPlayerUpdate(playerid)
{
new iCurWeap = GetPlayerWeapon(playerid);
if(iCurWeap != iArmaatual[playerid])
{
OnPlayerChangeWeapon(playerid, iArmaatual[playerid], iCurWeap);
iArmaatual[playerid] = iCurWeap;
}
return 1;
}
public OnPlayerChangeWeapon(playerid, oldweapon, newweapon)
{
new s[128],
oWeapon[24],
nWeapon[24];
GetWeaponName(oldweapon, oWeapon, sizeof(oWeapon));
GetWeaponName(newweapon, nWeapon, sizeof(nWeapon));
format(s, sizeof(s), "Vocк jб trocou as armas.");
format(s, sizeof(s), "Sua arma velha era : %s agora a nova й : %s!", oWeapon, nWeapon);
SendClientMessage(playerid, 0xFFFFFFFF, s);
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/carma", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"Lista de Armas :",listitems,"Comprar","Cancelar");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 2) {
if(response) {
new message[256+1];
if(listitem == 0) {
format(message, 256, "Vocк escolheu : 'Desert Eagle'", listitem);
SendClientMessage(playerid, 0xFFFFFFFF, message);
GivePlayerMoney(playerid, -150);
GivePlayerWeapon (playerid, 24, 500);
} else if(listitem == 1) {
format(message, 256, "Vocк escolheu : 'Granadas'", listitem);
SendClientMessage(playerid, 0xFFFFFFFF, message);
GivePlayerMoney(playerid, -290);
GivePlayerWeapon (playerid, 16, 20);
} else if(listitem == 2) {
format(message, 256, "Vocк escolheu : 'Sawn-Off Shotgun'", listitem);
SendClientMessage(playerid, 0xFFFFFFFF, message);
GivePlayerMoney(playerid, -500);
GivePlayerWeapon (playerid, 26, 500);
} else if(listitem == 3) {
format(message, 256, "Vocк escolheu : 'Molotov'", listitem);
SendClientMessage(playerid, 0xFFFFFFFF, message);
GivePlayerMoney(playerid, -400);
GivePlayerWeapon (playerid, 18, 100);
} else if(listitem == 4) {
format(message, 256, "Vocк escolheu : 'Lanзador de Misseis'", listitem);
SendClientMessage(playerid, 0xFFFFFFFF, message);
GivePlayerMoney(playerid, -20000);
GivePlayerWeapon (playerid, 35, 500);
} else if(listitem == 5) {
format(message, 256, "Vocк escolheu : 'AK47'", listitem);
SendClientMessage(playerid, 0xFFFFFFFF, message);
GivePlayerMoney(playerid, -300);
GivePlayerWeapon (playerid, 30, 500);
} else if(listitem == 6) {
format(message, 256, "Vocк escolheu : 'M4'", listitem);
SendClientMessage(playerid, 0xFFFFFFFF, message);
GivePlayerMoney(playerid, -300);
GivePlayerWeapon (playerid, 31, 500);
}
}
}
return 1;
}
/////// // // //
// // //// ////
////// // // // // //
// // // // // //
// // // // // //
// // // /// //
Creditos :
Hades - Por Criar a FilterScript
Cidade - Por me ajudar
Schooc - Por Fazer o Logo Inicial
Ъtil em Servidores de DM