Error 001 expected token but found if

error 001 expected token but found if

If any one wants to help me, the attachement is the gamemode I downloaded. error 001: expected token: "}", but found "-identifier-". It's probably related to error 057: unfinished expression before compiler directive. Kinda off topic, but, why not just avoiding such. demo.p(3): error 001: expected token: ";", but found "{" Local labels and (compound) statements are only valid if used within functions.

Error 001 expected token but found if - that

gray offline\n"},
{"选择","Select"},
{"加好友","Add Friends"},

{"在线玩家","Online Players"},
{"玩家名\t位置\n","Player Name\tLocation\n"},
{"加为好友","Add to friends"},
{"关闭","Close"},

{"\t{C0C0C0}>>下一页>>\n","\t{C0C0C0}>>Next Page>>\n"},
{"\t{C0C0C0}<<上一页<<\n","\t{C0C0C0}<<Previous Page<<\n"},

{"序列错误,请稍后再试!","Sequence error, please try again later!"},
{"对方已下线!","The other party is offline!"},

{"加好友","add friend"},
{"是否加 %s 为好友?","Whether to add %s friends?"},
{"加为好友","Add to friends"},
{"算了","Forget it"},

{"你和 %s 本来就是好友!","You and %s are already friend!"},
{"%s 申请加你为好友,是否同意?","%s Apply to add you as a friend, agree?"},
{"好友通知","Friends notice"},
{"你加好友的通知已发送给 %s !","Your add friend notification has been sent to %s !"},

{"我的邮件[ %i 封未读][白色 已读 小键盘4键 伤害显示 keypad 4 damage display LCTRL Key Start Car
DaZzY
Offline

Posts:74
Threads:12
Joined: Oct 2020
Reputation:2
Hello i want to create a TD of FUEL And i get error when i use TextDrawSetString 

Quote:C:\Users\user\Desktop\Samp\samp server\gamemodes\SFUD.pwn(5445) : error 029: invalid expression, assumed zero
C:\Users\user\Desktop\Samp\samp server\gamemodes\SFUD.pwn(5445) : warning 215: expression has no effect
C:\Users\user\Desktop\Samp\samp server\gamemodes\SFUD.pwn(5445) : error 001: expected token: ";", but found "]"
C:\Users\user\Desktop\Samp\samp server\gamemodes\SFUD.pwn(5445) : error 029: invalid expression, assumed zero
C:\Users\user\Desktop\Samp\samp server\gamemodes\SFUD.pwn(5445) : fatal error 107: too many error messages on one line


This is on Gamemodeini :

Quote:g_Player[playerid][td_fuel] = CreatePlayerTextDraw(playerid,45.000000,324.000000,"Fuel: 100");
    PlayerTextDrawBackgroundColor(playerid,g_Player[playerid][td_fuel],0x00000033);
    PlayerTextDrawFont(playerid,g_Player[playerid][td_fuel],3); /
    PlayerTextDrawLetterSize(playerid,g_Player[playerid][td_fuel],0.699999,1.700000);
    PlayerTextDrawColor(playerid,g_Player[playerid][td_fuel],0x000000ff);
    TextDrawSetShadow(playerid,g_Player[playerid][td_fuel],3);



Quote:public timer_fuel_lower()
{
    for(new i=0;i<MAX_PLAYERS;i++) { //
        if (isrefuelling[i]) continue; //
        new vid = GetPlayerVehicleID(i); //
        if (GetPlayerVehicleSeat(i) == 0) { //
            fuel[vid] = fuel[vid] -1; //
            if (fuel[vid]<1) //
            {
                fuel[vid] = 0; //
                RemovePlayerFromVehicle(i); //
                GameTextForPlayer(i,"~r~You are out of ~w~fuel~r~!",5000,4); //
            }
        }

        new tdstring[32];
       format(tdstring,sizeof tdstring,"Fuel:%i",fuel[vid]);
        TextDrawSetString([td_fuel][i], tdstring); < Line 5445

    }

}


Whats wrong please ??
Expert*
Offline

Posts:61
Threads:2
Joined: Apr 2019
Reputation:4
2020-10-24, 05:35 PM (This post was last modified: 2020-10-24, 05:44 PM by Expert*.)
F
TextDrawSetString([td_fuel][i], tdstring);


btw,
start using this: sizeof( tdstring ) -1
So:



Also, you should check if g_Player[ i ][ td_fuel ] - Textdraw is created and used.
DaZzY
Offline

Posts:74
Threads:12
Joined: Oct 2020
Reputation:2
(2020-10-24, 05:35 PM)Expert* Wrote: F
TextDrawSetString([td_fuel][i], tdstring);


btw,
start using this: sizeof( tdstring ) -1
So:



Also, you should check if g_Player[ i ][ td_fuel ] - Textdraw is created and used.


Thank You that helping me so much :)

AllowPlayerTeleport() : function is deprecated.

Hello, everyone. I am a player from China.

Recently I thought about if there were multiple national languages in the server.

Is it possible to integrate players from different countries in a single server?

So I decided to release this script multilingual system.

What is a bilingual script?
Bilingual script

As the name implies, it is implemented on a server that players can understand.

languages of various countries,
For example, error 001 expected token but found if, on a server, the server is British.

But when you enter the server, you can see that there are two languages to choose from.

One is English and the other is Chinese.
Here's the picture.


Script code
enum
{
_NULL,

_DIALOG_ERROR,
_ANTICHEAT_MSG1,
_ANTICHEAT_MSG4,
_ANTICHEAT_MSG5,
_ANTICHEAT_MSG6,
_ANTICHEAT_MSG7,

_LOGIN_TITLE,
_LOGIN_BODY,
_LOGIN_BOTTON1,
_LOGIN_BOTTON2,
_LOGIN_ERROR_TITLE,
_LOGIN_ERROR_BODY,
_LOGIN_MSG1,
_LOGIN_MSG2,
_LOGIN_MSG3,
_LOGIN_MSG4,

_REG_TITLE,
_REG_BODY,
_REG_BOTTON1,
_REG_BOTTON2,
_REG_ERROR_TITLE,
_REG_ERROR_BODY,

_GAME_IN_TIP1,
_GAME_IN_TIP2,
_GAME_IN_TIP3,

_GAME_CIRCLE_0,
_GAME_CIRCLE_1,
_GAME_CIRCLE_2,
_GAME_CIRCLE_3,

_GAME_DEATH_1,
_GAME_DEATH_2,
_GAME_DEATH_3,

_GAME_WIN,

_GAME_CLOSE_BAG,
_GAME_CLOSE_MAP,

_WAITROOM_MSG,

_BAG_FULL,
_BAG_MSG1,
_BAG_MSG2,
_BAG_DIALOG1,
_BAG_DIALOG2,
_BAG_DIALOG3,
_BAG_DIALOG4,

_MALL_MSG1,
_MALL_MSG2,
_MALL_MSG3,
_MALL_DIALOG1,
_MALL_DIALOG2,
_MALL_DIALOG3,
_MALL_DIALOG4,

_MENU_CONFIG1,
_MENU_CONFIG2,
_MENU_CONFIG3,
_MENU_CONFIG4,

_MENU_SCENE1,
_MENU_SCENE2,
_MENU_SCENE3,
_MENU_SCENE4,
_MENU_SCENE_MSG1,
_MENU_SCENE_MSG2,

_MENU_COLOR_STR1,
_MENU_COLOR_SELECT1,
_MENU_COLOR_SELECT2,
_MENU_COLOR_SELECT3,
_MENU_COLOR_MSG1,
_MENU_COLOR_MSG2,

_MENU_SCENE_SELECT1,
_MENU_SCENE_SELECT2,
_MENU_SCENE_SELECT3,
_MENU_SCENE_SELECT_MSG1,
_MENU_SCENE_SELECT_MSG2,

_MENU_LANGUAGE1,
_MENU_LANGUAGE2,
_MENU_LANGUAGE3,
_MENU_LANGUAGE4,
_MENU_LANGUAGE_MSG1,
_MENU_LANGUAGE_MSG2,

_CREDITS_DIALOG1,
_CREDITS_DIALOG2,
_CREDITS_DIALOG3,
_CREDITS_DIALOG4,

_BOX_MSG1,

_GAME_BOX_MSG,
_GAME_WEATHER_MSG,

_UPDATE_DIALOG1,
_UPDATE_DIALOG2,
_UPDATE_DIALOG3,

_ATTACH_MSG1,
_ATTACH_MSG2,
_ATTACH_DIALOG1,
_ATTACH_DIALOG2,
_ATTACH_DIALOG3,
_ATTACH_DIALOG4,
_ATTACH_DROP_DIALOG1,
_ATTACH_DROP_DIALOG2,
_ATTACH_DROP_DIALOG3,
_ATTACH_DROP_DIALOG4,

_BOX_GIFT_MSG1,
_BOX_GIFT_MSG2,

_PLAYER_SAY_MSG1,
_PLAYER_SAY,
_PLAYER_LOCAT1,
_PLAYER_LOCAT2,
_PLAYER_LOCAT3,
_PLAYER_LOCAT4,
_PLAYER_LOCAT5,

_COME_IN,
_COME_OUT,
_COME_LOBBY,
_COME_IN_MSG1,

_TEST_MSG1,
_TEST_MSG2,
_TEST_DIALOG1,
_TEST_DIALOG2,
_TEST_DIALOG3,
_TEST_DIALOG4,

_PAUSE_KICK_MSG,

_AIR_DROP,

_AC_MSG1,
_AC_MSG2,

_FRIENDS_DIALOG1,
_FRIENDS_DIALOG2,
_FRIENDS_DIALOG3,
_FRIENDS_DIALOG4,

_ONLINES_DIALOG1,
_ONLINES_DIALOG2,
_ONLINES_DIALOG3,
_ONLINES_DIALOG4,

_NEXT_PAGE,
_PREV_PAGE,

_ARRAY_ERROR,
_PLAYER_OFFLINE,

_ONLINES_ADDFRIEND1,
_ONLINES_ADDFRIEND2,
_ONLINES_ADDFRIEND3,
_ONLINES_ADDFRIEND4,

_ADDFRI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_SAY_MSG3,
_PLAYER_SAY_MSG4,
_PLAYER_SAY_MSG5,
_PLAYER_SAY_MSG6,
_PLAYER_SAY_MSG7,

_ROOM_SELECT_MSG1,
_ROOM_SELECT_MSG2,
_ROOM_SELECT_MSG3,
_ROOM_SELECT_MSG4,

_CMD_MSG1,
_CMD_MSG2
}
enum MultiLanguage_Info
{
_cn[512],
_en[512]
}
new const MultiLanguage[][MultiLanguage_Info]=
{
{" "," "},

{"你可能使用对话框作弊,本次会话失效!","You may cheat using the dialog box, this session lapsed!"},
{"[反作弊] %s 可能使用作弊器刷出武器 %s !","[Anti-Cheat] %s may use cheating brush %s !"},
{"[反作弊] 你可能使用了穿墙作弊器,现将你恢复到当前坐标最高点!","[Anti-Cheat] You may have used a wall cheat, now you will be restored to the current coordinates of the highest point!"},
{"[反作弊] 请使用 {FF8000}SA-MP 0.3.7-R2{FFFFFF} 客户端登录,下载地址:http://www.sa-mp.com/download.php","[Anti-Cheat] Please login with {FF8000}SA-MP 0.3.7-R2{FFFFFF} client,download address:http://www.sa-mp.com/download.php"},
{"[反作弊] 你可能使用了无限弹药","[Anti-Cheat] You may have used unlimited ammunition"},
{"[反作弊] 你可能使用了速射","[Anti-Cheat] You may have used a rapid fire"},


{"你已注册,请登录账户","You have registered,Please login account"},
{"欢迎进入 %s [数据库ID: %i ],请输入密码登陆游戏!","Welcome %s [Database ID: %i ],Please enter the password login game"},
{"登录","Login"},
{"取消","Cancel"},
{"密码错误","Wrong Password"},
{"请输入重新密码来登陆","Please re-enter the password to login"},
{"点击左上角 {FF0000}PLAY{FFFFFF} 可以直接进入{FFFF00}自动匹配{FFFFFF}中!","Click Top left corner {FF0000}PLAY{FFFFFF} can enter the {FFFF00}game match directly{FFFFFF}!"},
{">>如果不想等待,输入 {FF0000}/exit{FFFFFF} 可以返回 {00FF80}前厅{FFFFFF}!",">>If you do not want to wait,enter {FF0000}/exit{FFFFFF} to return to the {00FF80}lobby{FFFFFF}!"},
{">>等候区娱乐功能:刷车[{00FF80}步行Y键{FFFFFF}] 音乐系统[{8080FF}小键盘6键 歌单 / 鼠标控制播放器{FFFFFF}]",">> Waiting Room features: Brush car [{00FF80}/c{FFFFFF}] music system [{00FF80}Keypad 6 Song list / mouse click player{FFFFFF}] "},
{"如需{FFFF00}手动匹配{FFFFFF},请点击左侧 {80FFFF}黑色双人图标","For {FFFF00} manual match {FFFFFF},click the {80FFFF} black double icon {FFFFFF}on the left"},

{"你未注册,请注册账户","You are not registered, please register an account"},
{"欢迎进入,%s,你还没有注册,请注册并登陆游戏","Welcome, %s,You are not registered,Please register and login to the game"},
{"注册","Registered"},
{"取消","Cancel"},
{"字符过少或过多[4-15个字符]","Too few or too many characters [4-15 characters]"},
{"请重新输入密码来注册","Please re-enter the password to register"},

{">帮助> F键 跳伞 N Key Radar gray offline]"},
{"发送人\t标题\t时间\n","Sender\ttitle\tSendTime\n"},
{"查看","View"},
{"取消","Cancel"},

{"%s","%s"},
{"打开邮件\n删除邮件\n全部提取附件\n清空邮件箱\n","Open mail\ndelete mail\n all extract attachments\nempty mailbox\n"},
{"选择","Selecct"},
{"取消","Cancel"},

{"邮件来自:%s\n","Mail From:%s\n"},
{"发送时间:%s\n\n","Send Time:%s\n\n"},
{"内容\n","Content\n"},
{"附件\n","Attachments\n"},
{"无\n","Null\n"},
{"金币: %i\n","Gold:%i\n"},
{"道具: %s 数量: %i\n","Item: %s Amount: %i\n"},

{"提取附件","Extract attachments"},
{"关闭","Closed"},
{"同意","Agree"},
{"拒绝","Refuse"},

{"邮件删除成功!","Mail deleted successfully!"},
{"清空邮件箱成功!","Clear mail box success!"},
{"你的邮件箱里没有邮件!","There is no mail in your mail box!"},

{"对方没有在线!","The other player is not online!"},
{"对方已经是你的好友了!","The other playeris already your error 001 expected token but found if mailbox or the other's mailbox is almost full!"},
{"数据异常!","Data is abnormal!"},
{"你同意添加 %s 为好友!","You agree to add %s as a friend!"},
{"添加 %s 为好友成功!","Add %s as a friend successfully!"},

{"邀请好友组队\n删除好友","Invite friends to team up\nDelete Friend"},
{"好友[ %s ]设置","Friend[ %s ]Set"},
{"选择","Selecct"},
{"取消","Cancel"},
{"删除好友成功!","Delete friend success!"},
{"删除好友失败,对方不是你的好友!","Delete friends failed, the other is not your friend!"},

{"金币附件: $%i 提取成功!","Gold attachments: $%i Extraction successful!"},
{"道具附件: %s X%i 提取成功!","Item attachments: %s X%i Extraction canon mp240 error code e5 %s X%i 提取失败,背包容量不足!","Item attachments: %s X%i Extraction failed,Backpack capacity is not enough!"},
{"邮件没有附件!","email has no attachments!"},
{"{FF0000}系统邮件{FFFFFF}","{FF0000}System Mail{FFFFFF}"},

{"队伍模式","Team Mode"},
{"当前状态: %s\n创建队伍\n队员列表\n解散/离开队伍","Current status: %s\nCreate team\nTeam members list\nDissolve/Leave team"},
{"选择","Select"},
{"关闭","Close"},
{"单人模式","Solo"},
{"组队模式 灰色 未读]","My mails[ %i Cover Unread][white online 小键盘4键 伤害显示 keypad 4 damage display

watch the video

World's *RAREST* Things ONLY 1% of Humans CAN DO!

1 Comments

Leave a Comment