guys please help
#1

guys its me again i maked an /buyroom for the hotel and i dont know why dont give money to the motel owner look here and help me please ! the biz number is 28

if(strcmp(cmd, "/buyroom", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (!PlayerToPoint(100, playerid,2217.4653,-1147.1382,1025.7969))//centerpoint 24-7
{
SendClientMessage(playerid, COLOR_GRAD2, " You are not to the Jeferson Motel Reception! !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /buy [item number]");
SendClientMessage(playerid, COLOR_GREEN, "|_______ 24-7 _______|");
SendClientMessage(playerid, COLOR_WHITE, "| 1: Motel Room 1 $1500 2: Motel Room 2 $1500");
SendClientMessage(playerid, COLOR_WHITE, "| 3: Motel Room 3 $1500 4: Motel Room 4 $1500");
SendClientMessage(playerid, COLOR_WHITE, "| 5: Motel Room 5 $1500 6: Motel Room 6 $1500");
SendClientMessage(playerid, COLOR_WHITE, "| 7: Motel Room 7 $1500 8: Motel Room 8 $1500");
return 1;
}
new item = strvalEx(tmp);
if(BizzInfo[28][sbProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
return 1;
}
if (item == 1 && GetPlayerMoney(playerid) > 1500)
{
if(PlayerInfo[playerid][pTraderPerk] > 0)
{
new skill = 1500 / 10;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 1500 - price;
GivePlayerMoney(playerid, - payout);
format(string, sizeof(string), "~r~-$%d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
BizzInfo[28][sbTill] + payout;
BizzInfo[28][sbTill] +payout;
}
else
{
GivePlayerMoney(playerid, - 1500);
format(string, sizeof(string), "~r~-$%d", 1500);
GameTextForPlayer(playerid, string, 5000, 1);
}
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "Motel Room buyed!.");
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_WHITE, "HINT: You will spawn now here till unrent!.");
PlayerInfo[playerid][pPmotelkey] = 1;
return 1;
}
Reply
#2

Quote:
Originally Posted by KennYthegod
guys its me again i maked an /buyroom for the hotel and i dont know why dont give money to the motel owner look here and help me please ! the biz number is 28

if(strcmp(cmd, "/buyroom", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (!PlayerToPoint(100, playerid,2217.4653,-1147.1382,1025.7969))//centerpoint 24-7
{
SendClientMessage(playerid, COLOR_GRAD2, " You are not to the Jeferson Motel Reception! !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /buy [item number]");
SendClientMessage(playerid, COLOR_GREEN, "|_______ 24-7 _______|");
SendClientMessage(playerid, COLOR_WHITE, "| 1: Motel Room 1 $1500 2: Motel Room 2 $1500");
SendClientMessage(playerid, COLOR_WHITE, "| 3: Motel Room 3 $1500 4: Motel Room 4 $1500");
SendClientMessage(playerid, COLOR_WHITE, "| 5: Motel Room 5 $1500 6: Motel Room 6 $1500");
SendClientMessage(playerid, COLOR_WHITE, "| 7: Motel Room 7 $1500 8: Motel Room 8 $1500");
return 1;
}
new item = strvalEx(tmp);
if(BizzInfo[28][sbProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
return 1;
}
if (item == 1 && GetPlayerMoney(playerid) > 1500)
{
if(PlayerInfo[playerid][pTraderPerk] > 0)
{
new skill = 1500 / 10;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 1500 - price;
GivePlayerMoney(playerid, - payout);
format(string, sizeof(string), "~r~-$%d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
BizzInfo[28][sbTill] + payout;
BizzInfo[28][sbTill] +payout;
}
else
{
GivePlayerMoney(playerid, - 1500);
format(string, sizeof(string), "~r~-$%d", 1500);
GameTextForPlayer(playerid, string, 5000, 1);
}
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "Motel Room buyed!.");
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_WHITE, "HINT: You will spawn now here till unrent!.");
PlayerInfo[playerid][pPmotelkey] = 1;
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)