02.02.2014, 15:39
here are the erros i keep getting i cant seem to fix them.
this one below shows error 017: undefined symbol "mysql_query"
the same error 017: undefined symbol "mysql_query"
still the same error MYSQL.
Код:
error 001: expected token: "-identifier-", but found "(" error 017: undefined symbol "mysql_query" error 017: undefined symbol "mysql_query" error 017: undefined symbol "mysql_query" error 017: undefined symbol "mysql_query" error 017: undefined symbol "mysql_query" error 017: undefined symbol "mysql_query" error 017: undefined symbol "mysql_query" error 017: undefined symbol "mysql_query" error 017: undefined symbol "rBit1_Set" error 017: undefined symbol "mysql_query" error 017: undefined symbol "mysql_query" error 017: undefined symbol "mysql_query" error 017: undefined symbol "mysql_query" error 017: undefined symbol "mysql_query" error 017: undefined symbol "mysql_query" error 017: undefined symbol "mysql_query" error 017: undefined symbol "mysql_query" error 017: undefined symbol "mysql_query"
Код:
error line 15 new rBit1: PlayerLogged <MAX_PLAYERS>;
this one below shows error 017: undefined symbol "mysql_query"
Код:
timer LoadingScreenTimer[100](playerid) { LoadingPercentage[playerid] ++; format(string, sizeof(string), "%d%%~n~~w~Loading...", LoadingPercentage[playerid]); TextDrawSetString(RegisterLoginTD[playerid][5], string); if(LoadingPercentage[playerid] == 100) { SendClientMessage(playerid, COLOR_YELLOW, "Use keys up-down and right-left and when you select action press F!"); format(string, sizeof(string), "Welcome %s~n~~n~Please type your password!", GetName(playerid)); TextDrawSetString(RegisterLoginTD[playerid][0], string); LoadingPercentage[playerid] = 0; TextDrawHideForPlayer(playerid, RegisterLoginTD[playerid][5]); mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e'", GetName(playerid)); mysql_query(Query); mysql_store_result(); SelectedCharacter[playerid] = 0; if(mysql_num_rows() == 1) { SendClientMessage(playerid, COLOR_LIME, "You are registered, please type your password!"); CPLK[playerid] = repeat CheckPlayerLoginKeys(playerid); TextDrawSetString(RegisterLoginTD[playerid][2], "LOGIN DELETE"); } else { SendClientMessage(playerid, COLOR_LIME, "You are not registered, please type your new password!"); CPRK[playerid] = repeat CheckPlayerRegisterKeys(playerid); TextDrawSetString(RegisterLoginTD[playerid][2], "REGISTER DELETE"); } TextDrawSetString(RegisterLoginTD[playerid][1], "~b~~h~A ~w~B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); for(new td = 0; td <= 2; td++) { TextDrawShowForPlayer(playerid, RegisterLoginTD[playerid][td]); } TextDrawShowForPlayer(playerid, RegisterLoginTD2[0]); TextDrawShowForPlayer(playerid, RegisterLoginTD2[1]); TextDrawShowForPlayer(playerid, RegisterLoginTD2[2]); stop LST[playerid]; } mysql_free_result(); return 1; }
Код:
timer CheckPlayerLoginKeys[200](playerid) { new keys, ud, lr; GetPlayerKeys(playerid, keys, ud, lr); if(lr > 0) { SelectedCharacter[playerid] ++; TextDrawSetString(RegisterLoginTD[playerid][1], "~w~A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e'", GetName(playerid)); mysql_query(Query); mysql_store_result(); if(mysql_num_rows() == 1) TextDrawSetString(RegisterLoginTD[playerid][2], "~w~LOGIN DELETE"); else TextDrawSetString(RegisterLoginTD[playerid][2], "~w~REGISTER DELETE"); } else if(lr < 0) { SelectedCharacter[playerid] --; TextDrawSetString(RegisterLoginTD[playerid][1], "~w~A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e'", GetName(playerid)); mysql_query(Query); mysql_store_result(); if(mysql_num_rows() == 1) TextDrawSetString(RegisterLoginTD[playerid][2], "~w~LOGIN DELETE"); else TextDrawSetString(RegisterLoginTD[playerid][2], "~w~REGISTER DELETE"); } if(SelectedCharacter[playerid] == 0) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "~b~~h~A ~w~B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 1) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A ~b~~h~B ~w~C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 2) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B ~b~~h~C ~w~D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 3) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C ~b~~h~D ~w~E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 4) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D ~b~~h~E ~w~F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 5) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E ~b~~h~F ~w~G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 6) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F ~b~~h~G ~w~H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 7) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G ~b~~h~H ~w~I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 8) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H ~b~~h~I ~w~J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 9) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I ~b~~h~J ~w~K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 10) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J ~b~~h~K ~w~L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 11) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K ~b~~h~L ~w~M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 12) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L ~b~~h~M ~w~N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 13) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M ~b~~h~N ~w~O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 14) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N ~b~~h~O ~w~P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 15) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O ~b~~h~P ~w~R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 16) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P ~b~~h~R ~w~S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 17) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R ~b~~h~S~n~~w~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 18) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~~b~~h~T ~w~U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 19) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T ~b~~h~U ~w~V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 20) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U ~b~~h~V ~w~Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 21) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V ~b~~h~Z ~w~Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 22) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z ~b~~h~Q ~w~W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 23) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q ~b~~h~W ~w~Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 24) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q W ~b~~h~Y ~w~X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 25) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y ~b~~h~X ~w~0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 26) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X ~b~~h~0 ~w~1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 27) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 ~b~~h~1 ~w~2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 28) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 ~b~~h~2 ~w~3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 29) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 ~b~~h~3 ~w~4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 30) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 ~b~~h~4 ~w~5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 31) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 ~b~~h~5 ~w~6 7 8 9"); } else if(SelectedCharacter[playerid] == 32) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 ~b~~h~6 ~w~7 8 9"); } else if(SelectedCharacter[playerid] == 33) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 ~b~~h~7 ~w~8 9"); } else if(SelectedCharacter[playerid] == 34) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 ~b~~h~8 ~w~9"); } else if(SelectedCharacter[playerid] == 35) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 ~b~~h~9"); } else if(SelectedCharacter[playerid] == 36) { TextDrawSetString(RegisterLoginTD[playerid][1], "~w~A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e'", GetName(playerid)); mysql_query(Query); mysql_store_result(); if(mysql_num_rows() == 1) TextDrawSetString(RegisterLoginTD[playerid][2], "~b~~h~LOGIN ~w~DELETE"); else TextDrawSetString(RegisterLoginTD[playerid][2], "~b~~h~REGISTER ~w~DELETE"); PlaceWhereIsCharacter[playerid] = 2; } else if(SelectedCharacter[playerid] == 37) { TextDrawSetString(RegisterLoginTD[playerid][1], "~w~A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e'", GetName(playerid)); mysql_query(Query); mysql_store_result(); if(mysql_num_rows() == 1) TextDrawSetString(RegisterLoginTD[playerid][2], "~w~LOGIN ~b~~h~DELETE"); else TextDrawSetString(RegisterLoginTD[playerid][2], "~w~REGISTER ~b~~h~DELETE"); PlaceWhereIsCharacter[playerid] = 2; } else if(SelectedCharacter[playerid] == 38) SelectedCharacter[playerid] = 0; else if(SelectedCharacter[playerid] == -1) SelectedCharacter[playerid] = 37; if(ud > 0) { TextDrawSetString(RegisterLoginTD[playerid][1], "~w~A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e'", GetName(playerid)); mysql_query(Query); mysql_store_result(); if(mysql_num_rows() == 1) TextDrawSetString(RegisterLoginTD[playerid][2], "~w~LOGIN DELETE"); else TextDrawSetString(RegisterLoginTD[playerid][2], "~w~REGISTER DELETE"); if(PlaceWhereIsCharacter[playerid] == 0) { SelectedCharacter[playerid] = 18; } if(PlaceWhereIsCharacter[playerid] == 1) { SelectedCharacter[playerid] = 36; } if(PlaceWhereIsCharacter[playerid] == 2) { SelectedCharacter[playerid] = 0; } } else if(ud < 0) { TextDrawSetString(RegisterLoginTD[playerid][1], "~w~A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e'", GetName(playerid)); mysql_query(Query); mysql_store_result(); if(mysql_num_rows() == 1) TextDrawSetString(RegisterLoginTD[playerid][2], "~w~LOGIN DELETE"); else TextDrawSetString(RegisterLoginTD[playerid][2], "~w~REGISTER DELETE"); if(PlaceWhereIsCharacter[playerid] == 0) { SelectedCharacter[playerid] = 36; } if(PlaceWhereIsCharacter[playerid] == 1) { SelectedCharacter[playerid] = 0; } if(PlaceWhereIsCharacter[playerid] == 2) { SelectedCharacter[playerid] = 18; } } if(keys == KEY_SECONDARY_ATTACK) { TextDrawShowForPlayer(playerid, RegisterLoginTD[playerid][3]); if(strlen(InputedWord[playerid]) <= 15) { if(SelectedCharacter[playerid] == 0) { strcat(InputedWord[playerid], "A"); } else if(SelectedCharacter[playerid] == 1) { strcat(InputedWord[playerid], "B"); } else if(SelectedCharacter[playerid] == 2) { strcat(InputedWord[playerid], "C"); } else if(SelectedCharacter[playerid] == 3) { strcat(InputedWord[playerid], "D"); } else if(SelectedCharacter[playerid] == 4) { strcat(InputedWord[playerid], "E"); } else if(SelectedCharacter[playerid] == 5) { strcat(InputedWord[playerid], "F"); } else if(SelectedCharacter[playerid] == 6) { strcat(InputedWord[playerid], "G"); } else if(SelectedCharacter[playerid] == 7) { strcat(InputedWord[playerid], "H"); } else if(SelectedCharacter[playerid] == 8) { strcat(InputedWord[playerid], "I"); } else if(SelectedCharacter[playerid] == 9) { strcat(InputedWord[playerid], "J"); } else if(SelectedCharacter[playerid] == 10) { strcat(InputedWord[playerid], "K"); } else if(SelectedCharacter[playerid] == 11) { strcat(InputedWord[playerid], "L"); } else if(SelectedCharacter[playerid] == 12) { strcat(InputedWord[playerid], "M"); } else if(SelectedCharacter[playerid] == 13) { strcat(InputedWord[playerid], "N"); } else if(SelectedCharacter[playerid] == 14) { strcat(InputedWord[playerid], "O"); } else if(SelectedCharacter[playerid] == 15) { strcat(InputedWord[playerid], "P"); } else if(SelectedCharacter[playerid] == 16) { strcat(InputedWord[playerid], "R"); } else if(SelectedCharacter[playerid] == 17) { strcat(InputedWord[playerid], "S"); } else if(SelectedCharacter[playerid] == 18) { strcat(InputedWord[playerid], "T"); } else if(SelectedCharacter[playerid] == 19) { strcat(InputedWord[playerid], "U"); } else if(SelectedCharacter[playerid] == 20) { strcat(InputedWord[playerid], "V"); } else if(SelectedCharacter[playerid] == 21) { strcat(InputedWord[playerid], "Z"); } else if(SelectedCharacter[playerid] == 22) { strcat(InputedWord[playerid], "Q"); } else if(SelectedCharacter[playerid] == 23) { strcat(InputedWord[playerid], "W"); } else if(SelectedCharacter[playerid] == 24) { strcat(InputedWord[playerid], "Y"); } else if(SelectedCharacter[playerid] == 25) { strcat(InputedWord[playerid], "X"); } else if(SelectedCharacter[playerid] == 26) { strcat(InputedWord[playerid], "0"); } else if(SelectedCharacter[playerid] == 27) { strcat(InputedWord[playerid], "1"); } else if(SelectedCharacter[playerid] == 28) { strcat(InputedWord[playerid], "2"); } else if(SelectedCharacter[playerid] == 29) { strcat(InputedWord[playerid], "3"); } else if(SelectedCharacter[playerid] == 30) { strcat(InputedWord[playerid], "4"); } else if(SelectedCharacter[playerid] == 31) { strcat(InputedWord[playerid], "5"); } else if(SelectedCharacter[playerid] == 32) { strcat(InputedWord[playerid], "6"); } else if(SelectedCharacter[playerid] == 33) { strcat(InputedWord[playerid], "7"); } else if(SelectedCharacter[playerid] == 34) { strcat(InputedWord[playerid], "8"); } else if(SelectedCharacter[playerid] == 35) { strcat(InputedWord[playerid], "9"); } } if(SelectedCharacter[playerid] == 36) { mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e' AND `Password` = md5('%e')", GetName(playerid), InputedWord[playerid]); mysql_query(Query); mysql_store_result(); if(mysql_num_rows() == 1) { if(mysql_fetch_row_format(Query, "|")) { mysql_fetch_field_row(string, "Admin"); PlayerInfo[playerid][pAdmin] = strval(string); mysql_fetch_field_row(string, "Gamemaster"); PlayerInfo[playerid][pGameMaster] = strval(string); mysql_fetch_field_row(string, "Kills"); PlayerInfo[playerid][pKills] = strval(string); mysql_fetch_field_row(string, "Deaths"); PlayerInfo[playerid][pDeaths] = strval(string); for(new td = 0; td <= 5; td++) { TextDrawHideForPlayer(playerid, RegisterLoginTD[playerid][td]); TextDrawDestroy(RegisterLoginTD[playerid][td]); } for(new td2 = 0; td2 <= 6; td2++) { TextDrawHideForPlayer(playerid, RegisterLoginTD2[td2]); } rBit1_Set(PlayerLogged, playerid, 1); TogglePlayerSpectating(playerid, 0); TogglePlayerControllable(playerid, 1); SetCameraBehindPlayer(playerid); format(InputedWord[playerid], 25, "\0"); SpawnPlayer(playerid); } } else { SetPVarInt(playerid, "WrongPassword", GetPVarInt(playerid, "WrongPassword") + 1); TextDrawShowForPlayer(playerid, RegisterLoginTD[playerid][4]); format(string, sizeof(string), "Wrong typed password (%d)", GetPVarInt(playerid, "WrongPassword")); strdel(InputedWord[playerid], 0, 15); format(InputedWord[playerid], 25, "\0"); TextDrawSetString(RegisterLoginTD[playerid][4], string); SelectedCharacter[playerid] = 0; mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e'", GetName(playerid)); mysql_query(Query); mysql_store_result(); if(mysql_num_rows() == 1) TextDrawSetString(RegisterLoginTD[playerid][2], "~w~LOGIN DELETE"); else TextDrawSetString(RegisterLoginTD[playerid][2], "~w~REGISTER DELETE"); if(GetPVarInt(playerid, "WrongPassword") == 3) { for(new chat = 0; chat <= 30; chat++) { SendClientMessage(playerid, -1, ""); } mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e'", GetName(playerid)); mysql_query(Query); mysql_store_result(); if(mysql_num_rows() == 1) TextDrawSetString(RegisterLoginTD[playerid][2], "~w~LOGIN DELETE"); else TextDrawSetString(RegisterLoginTD[playerid][2], "~w~REGISTER DELETE"); SelectedCharacter[playerid] = 0; strdel(InputedWord[playerid], 0, 15); format(InputedWord[playerid], 25, "\0"); TextDrawSetString(RegisterLoginTD[playerid][3], InputedWord[playerid]); SendClientMessage(playerid, COLOR_KRED, "You typed 3 times wrong password!"); Kick(playerid); } } mysql_free_result(); } else if(SelectedCharacter[playerid] == 37) { strdel(InputedWord[playerid], (strlen(InputedWord[playerid]) - 1), strlen(InputedWord[playerid])); } TextDrawSetString(RegisterLoginTD[playerid][3], InputedWord[playerid]); } return 1; }
Код:
timer CheckPlayerRegisterKeys[200](playerid) { new keys, ud, lr; GetPlayerKeys(playerid, keys, ud, lr); if(lr > 0) { SelectedCharacter[playerid] ++; TextDrawSetString(RegisterLoginTD[playerid][1], "~w~A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e'", GetName(playerid)); mysql_query(Query); mysql_store_result(); if(mysql_num_rows() == 1) TextDrawSetString(RegisterLoginTD[playerid][2], "~w~LOGIN DELETE"); else TextDrawSetString(RegisterLoginTD[playerid][2], "~w~REGISTER DELETE"); } else if(lr < 0) { SelectedCharacter[playerid] --; TextDrawSetString(RegisterLoginTD[playerid][1], "~w~A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e'", GetName(playerid)); mysql_query(Query); mysql_store_result(); if(mysql_num_rows() == 1) TextDrawSetString(RegisterLoginTD[playerid][2], "~w~LOGIN DELETE"); else TextDrawSetString(RegisterLoginTD[playerid][2], "~w~REGISTER DELETE"); } if(SelectedCharacter[playerid] == 0) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "~b~~h~A ~w~B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 1) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A ~b~~h~B ~w~C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 2) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B ~b~~h~C ~w~D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 3) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C ~b~~h~D ~w~E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 4) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D ~b~~h~E ~w~F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 5) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E ~b~~h~F ~w~G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 6) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F ~b~~h~G ~w~H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 7) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G ~b~~h~H ~w~I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 8) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H ~b~~h~I ~w~J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 9) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I ~b~~h~J ~w~K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 10) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J ~b~~h~K ~w~L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 11) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K ~b~~h~L ~w~M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 12) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L ~b~~h~M ~w~N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 13) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M ~b~~h~N ~w~O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 14) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N ~b~~h~O ~w~P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 15) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O ~b~~h~P ~w~R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 16) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P ~b~~h~R ~w~S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 17) { PlaceWhereIsCharacter[playerid] = 0; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R ~b~~h~S~n~~w~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 18) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~~b~~h~T ~w~U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 19) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T ~b~~h~U ~w~V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 20) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U ~b~~h~V ~w~Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 21) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V ~b~~h~Z ~w~Q W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 22) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z ~b~~h~Q ~w~W Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 23) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q ~b~~h~W ~w~Y X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 24) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q W ~b~~h~Y ~w~X 0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 25) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y ~b~~h~X ~w~0 1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 26) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X ~b~~h~0 ~w~1 2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 27) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 ~b~~h~1 ~w~2 3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 28) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 ~b~~h~2 ~w~3 4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 29) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 ~b~~h~3 ~w~4 5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 30) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 ~b~~h~4 ~w~5 6 7 8 9"); } else if(SelectedCharacter[playerid] == 31) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 ~b~~h~5 ~w~6 7 8 9"); } else if(SelectedCharacter[playerid] == 32) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 ~b~~h~6 ~w~7 8 9"); } else if(SelectedCharacter[playerid] == 33) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 ~b~~h~7 ~w~8 9"); } else if(SelectedCharacter[playerid] == 34) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 ~b~~h~8 ~w~9"); } else if(SelectedCharacter[playerid] == 35) { PlaceWhereIsCharacter[playerid] = 1; TextDrawSetString(RegisterLoginTD[playerid][1], "A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 ~b~~h~9"); } else if(SelectedCharacter[playerid] == 36) { TextDrawSetString(RegisterLoginTD[playerid][1], "~w~A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e'", GetName(playerid)); mysql_query(Query); mysql_store_result(); if(mysql_num_rows() == 1) TextDrawSetString(RegisterLoginTD[playerid][2], "~b~~h~LOGIN ~w~DELETE"); else TextDrawSetString(RegisterLoginTD[playerid][2], "~b~~h~REGISTER ~w~DELETE"); PlaceWhereIsCharacter[playerid] = 2; } else if(SelectedCharacter[playerid] == 37) { TextDrawSetString(RegisterLoginTD[playerid][1], "~w~A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e'", GetName(playerid)); mysql_query(Query); mysql_store_result(); if(mysql_num_rows() == 1) TextDrawSetString(RegisterLoginTD[playerid][2], "~w~LOGIN ~b~~h~DELETE"); else TextDrawSetString(RegisterLoginTD[playerid][2], "~w~REGISTER ~b~~h~DELETE"); PlaceWhereIsCharacter[playerid] = 2; } else if(SelectedCharacter[playerid] == 38) SelectedCharacter[playerid] = 0; else if(SelectedCharacter[playerid] == -1) SelectedCharacter[playerid] = 37; if(ud > 0) { TextDrawSetString(RegisterLoginTD[playerid][1], "~w~A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e'", GetName(playerid)); mysql_query(Query); mysql_store_result(); if(mysql_num_rows() == 1) TextDrawSetString(RegisterLoginTD[playerid][2], "~w~LOGIN DELETE"); else TextDrawSetString(RegisterLoginTD[playerid][2], "~w~REGISTER DELETE"); if(PlaceWhereIsCharacter[playerid] == 0) { SelectedCharacter[playerid] = 18; } if(PlaceWhereIsCharacter[playerid] == 1) { SelectedCharacter[playerid] = 36; } if(PlaceWhereIsCharacter[playerid] == 2) { SelectedCharacter[playerid] = 0; } } else if(ud < 0) { TextDrawSetString(RegisterLoginTD[playerid][1], "~w~A B C D E F G H I J K L M N O P R S~n~T U V Z Q W Y X 0 1 2 3 4 5 6 7 8 9"); mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e'", GetName(playerid)); mysql_query(Query); mysql_store_result(); if(mysql_num_rows() == 1) TextDrawSetString(RegisterLoginTD[playerid][2], "~w~LOGIN DELETE"); else TextDrawSetString(RegisterLoginTD[playerid][2], "~w~REGISTER DELETE"); if(PlaceWhereIsCharacter[playerid] == 0) { SelectedCharacter[playerid] = 36; } if(PlaceWhereIsCharacter[playerid] == 1) { SelectedCharacter[playerid] = 0; } if(PlaceWhereIsCharacter[playerid] == 2) { SelectedCharacter[playerid] = 18; } } if(keys == KEY_SECONDARY_ATTACK) { TextDrawShowForPlayer(playerid, RegisterLoginTD[playerid][3]); if(strlen(InputedWord[playerid]) <= 15) { if(SelectedCharacter[playerid] == 0) { strcat(InputedWord[playerid], "A"); } else if(SelectedCharacter[playerid] == 1) { strcat(InputedWord[playerid], "B"); } else if(SelectedCharacter[playerid] == 2) { strcat(InputedWord[playerid], "C"); } else if(SelectedCharacter[playerid] == 3) { strcat(InputedWord[playerid], "D"); } else if(SelectedCharacter[playerid] == 4) { strcat(InputedWord[playerid], "E"); } else if(SelectedCharacter[playerid] == 5) { strcat(InputedWord[playerid], "F"); } else if(SelectedCharacter[playerid] == 6) { strcat(InputedWord[playerid], "G"); } else if(SelectedCharacter[playerid] == 7) { strcat(InputedWord[playerid], "H"); } else if(SelectedCharacter[playerid] == 8) { strcat(InputedWord[playerid], "I"); } else if(SelectedCharacter[playerid] == 9) { strcat(InputedWord[playerid], "J"); } else if(SelectedCharacter[playerid] == 10) { strcat(InputedWord[playerid], "K"); } else if(SelectedCharacter[playerid] == 11) { strcat(InputedWord[playerid], "L"); } else if(SelectedCharacter[playerid] == 12) { strcat(InputedWord[playerid], "M"); } else if(SelectedCharacter[playerid] == 13) { strcat(InputedWord[playerid], "N"); } else if(SelectedCharacter[playerid] == 14) { strcat(InputedWord[playerid], "O"); } else if(SelectedCharacter[playerid] == 15) { strcat(InputedWord[playerid], "P"); } else if(SelectedCharacter[playerid] == 16) { strcat(InputedWord[playerid], "R"); } else if(SelectedCharacter[playerid] == 17) { strcat(InputedWord[playerid], "S"); } else if(SelectedCharacter[playerid] == 18) { strcat(InputedWord[playerid], "T"); } else if(SelectedCharacter[playerid] == 19) { strcat(InputedWord[playerid], "U"); } else if(SelectedCharacter[playerid] == 20) { strcat(InputedWord[playerid], "V"); } else if(SelectedCharacter[playerid] == 21) { strcat(InputedWord[playerid], "Z"); } else if(SelectedCharacter[playerid] == 22) { strcat(InputedWord[playerid], "Q"); } else if(SelectedCharacter[playerid] == 23) { strcat(InputedWord[playerid], "W"); } else if(SelectedCharacter[playerid] == 24) { strcat(InputedWord[playerid], "Y"); } else if(SelectedCharacter[playerid] == 25) { strcat(InputedWord[playerid], "X"); } else if(SelectedCharacter[playerid] == 26) { strcat(InputedWord[playerid], "0"); } else if(SelectedCharacter[playerid] == 27) { strcat(InputedWord[playerid], "1"); } else if(SelectedCharacter[playerid] == 28) { strcat(InputedWord[playerid], "2"); } else if(SelectedCharacter[playerid] == 29) { strcat(InputedWord[playerid], "3"); } else if(SelectedCharacter[playerid] == 30) { strcat(InputedWord[playerid], "4"); } else if(SelectedCharacter[playerid] == 31) { strcat(InputedWord[playerid], "5"); } else if(SelectedCharacter[playerid] == 32) { strcat(InputedWord[playerid], "6"); } else if(SelectedCharacter[playerid] == 33) { strcat(InputedWord[playerid], "7"); } else if(SelectedCharacter[playerid] == 34) { strcat(InputedWord[playerid], "8"); } else if(SelectedCharacter[playerid] == 35) { strcat(InputedWord[playerid], "9"); } } else SendClientMessage(playerid, COLOR_KRED, "Lenght of password must be beetwen 8 & 15 characters!"); if(SelectedCharacter[playerid] == 36) { if(strlen(InputedWord[playerid]) < 8 || strlen(InputedWord[playerid]) > 15) return SendClientMessage(playerid, COLOR_KRED, "Lenght of password must be beetwen 8 & 15 characters!"); mysql_format(1, Query, "INSERT INTO `test_table` (`Name`, `Password`, `Admin`, `Gamemaster`, `Kills`, `Deaths`) VALUES ('%e', md5('%e'), 0, 0, 0, 0)", GetName(playerid), InputedWord[playerid]); mysql_query(Query); for(new td = 0; td <= 5; td++) { TextDrawHideForPlayer(playerid, RegisterLoginTD[playerid][td]); TextDrawDestroy(RegisterLoginTD[playerid][td]); } for(new td2 = 0; td2 <= 6; td2++) { TextDrawHideForPlayer(playerid, RegisterLoginTD2[td2]); } rBit1_Set(PlayerLogged, playerid, 1); TogglePlayerSpectating(playerid, 0); TogglePlayerControllable(playerid, 1); SetCameraBehindPlayer(playerid); format(InputedWord[playerid], 25, "\0"); SpawnPlayer(playerid); } else if(SelectedCharacter[playerid] == 37) { strdel(InputedWord[playerid], (strlen(InputedWord[playerid]) - 1), strlen(InputedWord[playerid])); } TextDrawSetString(RegisterLoginTD[playerid][3], InputedWord[playerid]); } return 1; }