pawno.foroactivo.com.es
¿Quieres reaccionar a este mensaje? Regístrate en el foro con unos pocos clics o inicia sesión para continuar.
pawno.foroactivo.com.es


 
ÍndiceÍndice  Últimas imágenesÚltimas imágenes  BuscarBuscar  RegistrarseRegistrarse  ConectarseConectarse  

 

 [Tutorial] Agregar armas para comprar a tu servidor!

Ir abajo 
AutorMensaje
Admin
Admin
Admin


Mensajes : 88
Fecha de inscripción : 29/05/2010

[Tutorial] Agregar armas para comprar a tu servidor! Empty
MensajeTema: [Tutorial] Agregar armas para comprar a tu servidor!   [Tutorial] Agregar armas para comprar a tu servidor! Icon_minitimeDom Mayo 30, 2010 10:29 pm

Hola amigos ahora hago este tuto o no se si cmd xD,, pero buehh aki va!

te vas a la callback de public OnPlayerCommandText(playerid, cmdtext[])

ya que esta ahi abajito pones


Spoiler:
if(strcmp(cmd, "/AdquirirArma", true) == 0)//nombre del comando
{
if(IsPlayerConnected(playerid))//si esta conectado lo puede usar
{
if (PlayerToPoint(20, playerid,X, Y, Z))//LUGAR DONDE PODRAS USAR EL CMD
{

tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Utiliza: /AdquirirArma [Numero Item]");
SendClientMessage(playerid, COLOR_GREEN, " |_______ Venta de armas _______|");
SendClientMessage(playerid, COLOR_GRAD2, "| 1: Desert Eagle [Balas: 50] $350 2: M4 [Balas: 250] $6.500");
SendClientMessage(playerid, COLOR_GRAD2, "| 3: Escopeta [Balas: 30] $3.000 4: MP5 [Balas: 250] $2.500");
SendClientMessage(playerid, COLOR_GRAD2, "| 5: SDPistol [Balas: 50] $450 ");

return 1;
}
new item = strval(tmp);
new x_job[256];
x_job = strtok(cmdtext, idx);
if(SBizzInfo[9][sbProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Fuera de Servicio", 5000, 1);
return 1;
}
if (item == 1 && GetPlayerMoney(playerid) > 350)
{
if(PlayerInfo[playerid][pLevel] < 2)//que solo lvl 2 puerda portarlas
{
SendClientMessage(playerid, COLOR_GREY, "No puedes Portar Armas siendo Nivel 1. ");
return 1;
}
else
{
SafeGivePlayerMoney(playerid, - 350);//dinero que se le quitara al PJ
GivePlayerWeapon(playerid, 24, 50);//arma y balas que se le dara 24 id de arma 50 balas
format(string, sizeof(string), "Pistola Comprada.");
GameTextForPlayer(playerid, string, 5000, 1);
return 1;
}
}
else if (item == 2 && GetPlayerMoney(playerid) > 6500)
{
if(PlayerInfo[playerid][pLevel] < 2)
{
SendClientMessage(playerid, COLOR_GREY, "No puedes Portar Armas siendo Nivel 1. ");
return 1;
}
else
{
SafeGivePlayerMoney(playerid, - 6500);
GivePlayerWeapon(playerid, 31, 250);
format(string, sizeof(string), "M4 Comprada.");
GameTextForPlayer(playerid, string, 5000, 1);
return 1;
}
}
else if (item == 3 && GetPlayerMoney(playerid) > 3000)
{
if(PlayerInfo[playerid][pLevel] < 2)
{
SendClientMessage(playerid, COLOR_GREY, "No puedes Portar Armas siendo Nivel 1. ");
return 1;
}
else
{
SafeGivePlayerMoney(playerid, - 3000);
GivePlayerWeapon(playerid, 25, 30);
format(string, sizeof(string), "Escopeta Comprada.");
GameTextForPlayer(playerid, string, 5000, 1);
return 1;
}
}
else if (item == 4 && GetPlayerMoney(playerid) > 2500)
{
if(PlayerInfo[playerid][pLevel] < 2)
{
SendClientMessage(playerid, COLOR_GREY, "No puedes Portar Armas siendo Nivel 1. ");
return 1;
}
else
{
SafeGivePlayerMoney(playerid, - 2500);
GivePlayerWeapon(playerid, 29, 250);
format(string, sizeof(string), "MP5 Comprada.");
GameTextForPlayer(playerid, string, 5000, 1);
return 1;
}
}
else if (item == 5 && GetPlayerMoney(playerid) > 450)
{
if(PlayerInfo[playerid][pLevel] < 2)
{
SendClientMessage(playerid, COLOR_GREY, "No puedes Portar Armas siendo Nivel 1. ");
return 1;
}
SafeGivePlayerMoney(playerid, - 450);
GivePlayerWeapon(playerid, 23, 50);
format(string, sizeof(string), "Pistola Comprada.");
GameTextForPlayer(playerid, string, 5000, 1);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " No estas en la Armeria !");
return 1;
}
}
}
return 1;
}



Buehhh es todo un comando facil pero de utilidad!

PD: si no te gusta por favor no comentes!

_________________
Volver arriba Ir abajo
https://pawno.foroactivo.com.es
 
[Tutorial] Agregar armas para comprar a tu servidor!
Volver arriba 
Página 1 de 1.
 Temas similares
-
» [Tutorial] Como agregar NPC's (Bots)
» [Tutorial] Agregar Cajeros al Vl-rp [Novatos]
» [Tutorial] Agregar Autos alos GM de RP
» Armas, objetos, etc. Para MTA.
» [TUTORIAL] Como crear un server-samp y [...] (para novatos)

Permisos de este foro:No puedes responder a temas en este foro.
pawno.foroactivo.com.es :: Tutoriales-
Cambiar a: