[Help] Message Cutting Off - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Help] Message Cutting Off (
/showthread.php?tid=442822)
[Help] Message Cutting Off -
Nick_Phelps - 09.06.2013
So, I am working on a credit system and one of the options is to get a house, now, when the player clicks on the house option it takes the amount of credits and it is suppose to send this message to an admin. "[CreditShop]: (NAME) has exchanged 100 credits for a house. Please issue it now."
However whenever I test it IG I get this message
"[CreditShop]: (NAME) has exchanged "
This is the code for the dialog option.
Код HTML:
if(listitem == 5) // Gate
{
new string[42], giveplayerid, shopstring[512];
if(PlayerInfo[playerid][pCredits] < 100)
{
return SendClientMessageEx(playerid, COLOR_GREY, " You do not have enough Credits !");
}
else
{
PlayerInfo[playerid][pCredits] = PlayerInfo[playerid][pCredits]-100;
format(string, sizeof(string), "[CreditShop]: %s has exchanged 100 credits for a house. Please issue it now.", GetPlayerNameEx(giveplayerid));
ShopTechBroadCast(COLOR_SHOP, string);
return SendClientMessageEx(playerid, COLOR_GREY, " You exchanged 100 Credits for a house gate. !");
}
}
Re: [Help] Message Cutting Off -
IceBilizard - 09.06.2013
Try this
pawn Код:
if(listitem == 5) // Gate
{
new string[42], giveplayerid, shopstring[512];
if(PlayerInfo[playerid][pCredits] < 100)
{
return SendClientMessageEx(playerid, COLOR_GREY, " You do not have enough Credits !");
}
else
{
new PName[MAX_PLAYER_NAME];
GetPlayerName(giveplayerid, PName, sizeof(PName));
PlayerInfo[playerid][pCredits] = PlayerInfo[playerid][pCredits]-100;
format(string, sizeof(string), "[CreditShop]: %s has exchanged 100 credits for a house. Please issue it now.", PName);
ShopTechBroadCast(COLOR_SHOP, string);
return SendClientMessageEx(playerid, COLOR_GREY, " You exchanged 100 Credits for a house gate. !");
}
}
Re: [Help] Message Cutting Off -
random123 - 09.06.2013
change
to
Without a players name that text alone takes up ~52 cells you need to increase the size of your string a significant bit. Anything related to SendClientMessage has a cap of 128 characters so anything higher then that is a waist of memory.
Re: [Help] Message Cutting Off -
Nick_Phelps - 09.06.2013
Quote:
Originally Posted by IceBilizard
Try this
pawn Код:
if(listitem == 5) // Gate { new string[42], giveplayerid, shopstring[512]; if(PlayerInfo[playerid][pCredits] < 100) { return SendClientMessageEx(playerid, COLOR_GREY, " You do not have enough Credits !"); } else { new PName[MAX_PLAYER_NAME]; GetPlayerName(giveplayerid, PName, sizeof(PName)); PlayerInfo[playerid][pCredits] = PlayerInfo[playerid][pCredits]-100; format(string, sizeof(string), "[CreditShop]: %s has exchanged 100 credits for a house. Please issue it now.", PName); ShopTechBroadCast(COLOR_SHOP, string); return SendClientMessageEx(playerid, COLOR_GREY, " You exchanged 100 Credits for a house gate. !"); } }
|
Did not seem to work
Re: [Help] Message Cutting Off -
FunnyBear - 09.06.2013
Change the string size from 42 to 128