[Help] Making a input box - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] Making a input box (
/showthread.php?tid=235956)
[Help] Making a input box -
darkknight123 - 06.03.2011
I'm trying to make a input box for my glasses system but when i try to compile it i get 26 errors I havnt scripted in a while so I'm a bit rusty, what did i do wrong?
Код:
if(dialogid == GLASS)
{
if(response)
{
if(!(strcal(inputtext) >= 33 && strval(inputtext) <= 1))
{
tmp = strtok(cmdtext, idx);
skin = GetPlayerSkin(playerid);
id = strval(tmp);
if(GetPlayerMoney(playerid) < 10) return SendClientMessage(playerid, 0x40FF00FF, "You dont have enough money");
id--;
glasseid = strval(inputtext));
SetPlayerHoldingObject(playerid, glasseid, 2, SkinOffSet[skin][0], SkinOffSet[skin][1], SkinOffSet[skin][2], SkinOffSet[skin][3], SkinOffSet[skin][4], SkinOffSet[skin][5]);
GivePlayerMoney(playerid,-10);
SendClientMessage(playerid, COLOR_YELLOW,"HINT:To take your glasses off use /glassesoff");
GetPlayerRPName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[96];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if (result[playerid] == '_')
result[playerid] = ' ';
if(!strlen(result))
{
if(PlayerInfo[playerid][pMask] == 1)
{
format(string, sizeof(string), "* The Stranger puts on a pair of sunglasses.");
}
else
{
format(string, sizeof(string), "* %s puts on a pair of sunglasses.", sendername);
}
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
Re: [Help] Making a input box -
Mean - 06.03.2011
Show the errors, highlight the error lines with "//" and use [ pawn ] [ /pawn ] because in [ code ] it's hardly readable.
Re: [Help] Making a input box -
darkknight123 - 06.03.2011
They are just like a bunch of random errors not even dealing with the code but if i "//" it all out the script compiles fine
heres the code
pawn Код:
if(dialogid == GLASS)
{
if(response)
{
if(!(strcal(inputtext) >= 33 && strval(inputtext) <= 1))
{
tmp = strtok(cmdtext, idx);
skin = GetPlayerSkin(playerid);
id = strval(tmp);
if(GetPlayerMoney(playerid) < 10) return SendClientMessage(playerid, 0x40FF00FF, "You dont have enough money");
id--;
glasseid = strval(inputtext));
SetPlayerHoldingObject(playerid, glasseid, 2, SkinOffSet[skin][0], SkinOffSet[skin][1], SkinOffSet[skin][2], SkinOffSet[skin][3], SkinOffSet[skin][4], SkinOffSet[skin][5]);
GivePlayerMoney(playerid,-10);
SendClientMessage(playerid, COLOR_YELLOW,"HINT:To take your glasses off use /glassesoff");
GetPlayerRPName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[96];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if (result[playerid] == '_')//Richard / Adam / Ray- Remove the _ from the name
result[playerid] = ' ';//Richard / Adam / Ray- Remove the _ from the name
if(!strlen(result))
{
if(PlayerInfo[playerid][pMask] == 1)
{
format(string, sizeof(string), "* The Stranger puts on a pair of sunglasses.");
}
else
{
format(string, sizeof(string), "* %s puts on a pair of sunglasses.", sendername);
}
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}