CMD:comprar(playerid, params[])
{
new string[256], options[256];
if(BusinessInfo[playerid][Type] == 1)
{
if(sscanf(params, "s[256]", options))
{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: /comprar [opзгo]");
SendClientMessage(playerid, COLOR_WHITE, "24/7: 1 - Taco de Baseball | 2 - Hamburguer | 3 - Camera");
SendClientMessage(playerid, COLOR_WHITE, "24/7: 4 - Pizza | 5 - Refrigerante");
return 1;
}
if(!strcmp(options, "1", true, 2))
{
GivePlayerWeapon(playerid, 5, 1);
GivePlayerMoney(playerid, -250);
SendClientMessage(playerid, COLOR_WHITE, "SERVER: Vocк comprou um taco de baseball.");
}
if(!strcmp(options, "2", true, 2))
{
SetPlayerHealth(playerid, 20);
GivePlayerMoney(playerid, -250);
SendClientMessage(playerid, COLOR_WHITE, "SERVER: Vocк comprou um hamburguer.");
}
if(!strcmp(options, "3", true, 2))
{
GivePlayerWeapon(playerid, 43, 20);
GivePlayerMoney(playerid, -250);
SendClientMessage(playerid, COLOR_WHITE, "SERVER: Vocк comprou uma camera.");
}
if(!strcmp(options, "4", true, 2))
{
SetPlayerHealth(playerid, 40);
GivePlayerMoney(playerid, -250);
SendClientMessage(playerid, COLOR_WHITE, "SERVER: Vocк comprou uma pizza.");
}
if(!strcmp(options, "5", true, 2))
{
SetPlayerHealth(playerid, 80);
GivePlayerMoney(playerid, -250);
SendClientMessage(playerid, COLOR_WHITE, "SERVER: Vocк comprou um refrigerante.");
}
}
else if(BusinessInfo[playerid][Type] == 3)
{
if(sscanf(params, "s[256]", options))
{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: /comprar [opзгo]");
SendClientMessage(playerid, COLOR_WHITE, "BURGER SHOT: 1 - Pizza | 2 - Hamburguer");
return 1;
}
if(!strcmp(options, "1", true, 2))
{
SetPlayerHealth(playerid, 40);
GivePlayerMoney(playerid, -250);
SendClientMessage(playerid, COLOR_WHITE, "SERVER: Vocк comprou uma pizza.");
}
if(!strcmp(options, "2", true, 2))
{
SetPlayerHealth(playerid, 20);
GivePlayerMoney(playerid, -250);
SendClientMessage(playerid, COLOR_WHITE, "SERVER: Vocк comprou um hamburguer.");
}
}
else if(BusinessInfo[playerid][Type] == 4)
{
if(sscanf(params, "s[256]", options))
{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: /comprar [opзгo]");
SendClientMessage(playerid, COLOR_WHITE, "AMMU NATION: 1 - Desert Eagle | 2 - Shotgun | 3 - MP5 | 4 - M4");
return 1;
}
if(!strcmp(options, "1", true, 2))
{
GivePlayerWeapon(playerid, 24, 17);
GivePlayerMoney(playerid, -2500);
SendClientMessage(playerid, COLOR_WHITE, "SERVER: Vocк comprou uma Desert Eagle.");
}
if(!strcmp(options, "2", true, 2))
{
GivePlayerWeapon(playerid, 25, 20);
GivePlayerMoney(playerid, -5000);
SendClientMessage(playerid, COLOR_WHITE, "SERVER: Vocк comprou uma Shotgun.");
}
if(!strcmp(options, "3", true, 2))
{
GivePlayerWeapon(playerid, 29, 150);
GivePlayerMoney(playerid, -8000);
SendClientMessage(playerid, COLOR_WHITE, "SERVER: Vocк comprou uma MP5.");
}
if(!strcmp(options, "4", true, 2))
{
GivePlayerWeapon(playerid, 31, 200);
GivePlayerMoney(playerid, -15000);
SendClientMessage(playerid, COLOR_WHITE, "SERVER: Vocк comprou uma M4.");
}
}
format(string, 256, "* %s leva sua mгo atй seu bolso, retirando sua carteira juntamente com algumas notas, entregando para o balconista.", RPName(playerid));
SendNearbyMessage(playerid, COLOR_PURPLE, string, 3);
return 1;
}
******.com й uma ferramenta de pesquisa maravilhosa!
http://pastebin.com/Y0VHKwsy |
Usa InsRageOfPoint to pelo celular acho que errei o nome, ai so colocar as pos de cada loja
|
if(IsPlayerInRangeOfPoint(playerid,5.0,X,Y,Z)) // local de onde й a 24/7 em x,y,z
acho que isso resolve
PHP код:
|