30.11.2011, 23:39
Boas pessoal, bem entгo й assim eu estava a criar o registo e quando vou para compilar dб-me estes erros:
C:\Users\tmn\Desktop\server\gamemodes\dalla's.pwn( 5) : error 001: expected token: ";", but found "public"
C:\Users\tmn\Desktop\server\gamemodes\dalla's.pwn( 163) : warning 209: function "OnPlayerCommandText" should return a value
C:\Users\tmn\Desktop\server\gamemodes\dalla's.pwn( 342) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
Error 001 expected token: ";", but found "public"
Warning 209: function "OnPlayerCommandText" should return a value
Error 010: invalid function or declaration
Й isso. Pessoal eu fiz o famoso "search" e mesmo assim nгo consegui coloca-lo a funcionar, entгo fiz questгo de criar um tуpico a pedir ajuda.
Obrigado desde jб. (:
C:\Users\tmn\Desktop\server\gamemodes\dalla's.pwn( 5) : error 001: expected token: ";", but found "public"
C:\Users\tmn\Desktop\server\gamemodes\dalla's.pwn( 163) : warning 209: function "OnPlayerCommandText" should return a value
C:\Users\tmn\Desktop\server\gamemodes\dalla's.pwn( 342) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
Error 001 expected token: ";", but found "public"
Код:
#include <a_samp> #include <dini> new Logado[1000] public OnGameModeInit() //Error 001 { // Don't use these lines if it's a filterscript SetGameModeText("Dallas's V1.0"); AddPlayerClass(188,-204.2155,1107.3578,19.7422,172.5134,0,0,0,0,0,0); //Mapa AddStaticVehicleEx(416,-304.50000000,1035.90002441,19.89999962,270.00000000,1,17,15); //Ambulance AddStaticVehicleEx(416,-304.60000610,1028.00000000,19.89999962,270.00000000,-1,-1,15); //Ambulance AddStaticVehicleEx(416,-304.70001221,1032.19995117,19.89999962,270.00000000,-1,-1,15); //Ambulance AddStaticVehicleEx(597,-226.30000305,991.79998779,19.39999962,270.00000000,116,1,15); //Police Car (SFPD) AddStaticVehicleEx(597,-226.19999695,995.29998779,19.39999962,270.00000000,116,1,15); //Police Car (SFPD) AddStaticVehicleEx(597,-226.10000610,998.90002441,19.50000000,270.00000000,116,1,15); //Police Car (SFPD) AddStaticVehicleEx(599,-221.10000610,1003.90002441,20.10000038,180.00000000,116,1,15); //Police Ranger AddStaticVehicleEx(523,-217.10000610,1004.29998779,19.39999962,180.00000000,-1,-1,15); //HPV1000 AddStaticVehicleEx(582,-80.50000000,1078.19995117,19.89999962,0.00000000,-1,1,15); //Newsvan AddStaticVehicleEx(582,-83.90000153,1078.19995117,19.89999962,0.00000000,-1,1,15); //Newsvan AddStaticVehicleEx(420,-201.80000305,1223.00000000,19.60000038,180.00000000,6,1,15); //Taxi AddStaticVehicleEx(420,-197.00000000,1223.09997559,19.60000038,180.00000000,6,1,15); //Taxi AddStaticVehicleEx(420,-194.19999695,1223.09997559,19.60000038,180.00000000,6,1,15); //Taxi AddStaticVehicleEx(420,-204.80000305,1223.09997559,19.60000038,180.00000000,6,1,15); //Taxi AddStaticVehicleEx(478,291.50000000,1148.19995117,8.69999981,0.00000000,86,1,15); //Walton AddStaticVehicleEx(478,294.60000610,1148.30004883,8.69999981,0.00000000,86,1,15); //Walton AddStaticVehicleEx(532,295.60000610,1131.00000000,10.10000038,90.00000000,86,1,15); //Combine AddStaticVehicleEx(445,-293.89999390,1294.40002441,53.59999847,80.00000000,65,1,15); //Admiral AddStaticVehicleEx(445,-293.50000000,1299.00000000,53.79999924,79.99694824,65,1,15); //Admiral AddStaticVehicleEx(445,-292.79998779,1303.30004883,53.90000153,79.99694824,65,1,15); //Admiral AddStaticVehicleEx(403,-289.60000610,1326.40002441,55.20000076,80.00000000,65,1,15); //Linerunner AddStaticVehicleEx(403,-290.39999390,1322.09997559,55.09999847,79.99694824,65,1,15); //Linerunner AddStaticVehicleEx(462,-292.29998779,1306.80004883,53.70000076,80.00000000,65,1,15); //Faggio AddStaticVehicleEx(462,-292.10000610,1308.00000000,53.70000076,79.99694824,65,1,15); //Faggio AddStaticVehicleEx(462,-291.89999390,1309.59997559,53.79999924,79.99694824,65,1,15); //Faggio AddStaticVehicleEx(408,-167.30000305,1012.40002441,20.50000000,90.00000000,6,1,15); //Trashmaster AddStaticVehicleEx(408,-167.69999695,1016.40002441,20.50000000,90.00000000,6,1,15); //Trashmaster AddStaticVehicleEx(408,-167.80000305,1020.20001221,20.50000000,90.00000000,6,1,15); //Trashmaster AddStaticVehicleEx(448,-178.89999390,1225.30004883,19.39999962,90.00000000,3,1,15); //Pizzaboy AddStaticVehicleEx(448,-178.80000305,1222.69995117,19.39999962,90.00000000,3,1,15); //Pizzaboy AddStaticVehicleEx(448,-178.80000305,1220.00000000,19.39999962,90.00000000,3,1,15); //Pizzaboy AddStaticVehicleEx(448,-178.89999390,1217.19995117,19.39999962,90.00000000,3,1,15); //Pizzaboy AddStaticVehicleEx(574,19.39999962,1163.69995117,19.39999962,0.00000000,-1,1,15); //Sweeper AddStaticVehicleEx(574,16.00000000,1163.90002441,19.39999962,0.00000000,-1,1,15); //Sweeper AddStaticVehicleEx(574,12.80000019,1163.90002441,19.39999962,0.00000000,-1,1,15); //Sweeper AddStaticVehicleEx(574,9.30000019,1163.90002441,19.39999962,0.00000000,-1,1,15); //Sweeper AddStaticVehicleEx(574,5.90000010,1163.90002441,19.39999962,0.00000000,-1,1,15); //Sweeper CreateObject(18319,-19.70000076,1316.50000000,48.20000076,0.00000000,0.00000000,310.00000000); //object(cs_landbit_30) (1) CreateObject(18319,319.69921875,1232.79980469,32.09999847,0.00000000,0.00000000,299.99816895); //object(cs_landbit_30) (2) CreateObject(18319,117.09999847,1302.69995117,30.89999962,0.00000000,0.00000000,299.99816895); //object(cs_landbit_30) (3) CreateObject(18319,319.69921875,1232.79980469,32.09999847,0.00000000,0.00000000,299.99816895); //object(cs_landbit_30) (4) CreateObject(3929,-27.50000000,1215.00000000,25.70000076,0.00000000,0.00000000,0.00000000); //object(d_rock) (1) CreateObject(18319,317.10000610,1196.40002441,20.00000000,0.00000000,0.00000000,270.00000000); //object(cs_landbit_30) (5) CreateObject(18319,-110.00000000,1320.80004883,57.90000153,0.00000000,0.00000000,305.00000000); //object(cs_landbit_30) (6) CreateObject(18319,-184.09960938,1316.79980469,32.50000000,0.00000000,0.00000000,300.00000000); //object(cs_landbit_30) (7) CreateObject(18319,-213.59960938,1369.89941406,113.09999847,0.00000000,0.00000000,299.99816895); //object(cs_landbit_30) (8) CreateObject(18319,-342.70001221,1390.50000000,57.00000000,0.00000000,0.00000000,248.99963379); //object(cs_landbit_30) (9) CreateObject(18319,-438.39999390,1475.69995117,34.70000076,0.00000000,0.00000000,299.99816895); //object(cs_landbit_30) (8) CreateObject(18319,-582.50000000,1488.90002441,5.40000010,0.00000000,0.00000000,299.99816895); //object(cs_landbit_30) (8) CreateObject(18329,-675.00000000,1486.59997559,70.19999695,0.00000000,0.00000000,0.00000000); //object(cs_landbit_40) (1) CreateObject(18329,-675.00000000,1486.59960938,70.19999695,0.00000000,0.00000000,0.00000000); //object(cs_landbit_40) (2) CreateObject(18319,-797.40002441,1372.50000000,70.40000153,0.00000000,0.00000000,1.00000000); //object(cs_landbit_30) (8) CreateObject(18319,-692.20001221,1369.30004883,24.79999924,0.00000000,0.00000000,0.99975586); //object(cs_landbit_30) (8) CreateObject(18319,-790.40002441,1256.90002441,57.70000076,0.00000000,0.00000000,0.99975586); //object(cs_landbit_30) (8) CreateObject(18319,-855.09997559,1184.19995117,91.90000153,0.00000000,0.00000000,45.00000000); //object(cs_landbit_30) (8) CreateObject(18319,-780.00000000,1049.00000000,31.89999962,0.00000000,0.00000000,80.00000000); //object(cs_landbit_30) (8) CreateObject(18319,-688.29998779,974.90002441,68.80000305,0.00000000,0.00000000,100.00000000); //object(cs_landbit_30) (8) CreateObject(18319,-559.29998779,934.40002441,10.19999981,0.00000000,0.00000000,99.99755859); //object(cs_landbit_30) (8) CreateObject(18319,-480.50000000,862.29998779,72.80000305,0.00000000,0.00000000,80.00000000); //object(cs_landbit_30) (8) CreateObject(18319,-358.20001221,795.90002441,69.40000153,0.00000000,0.00000000,75.00000000); //object(cs_landbit_30) (8) CreateObject(18319,-278.89999390,720.29998779,80.50000000,0.00000000,0.00000000,130.00000000); //object(cs_landbit_30) (8) CreateObject(18319,-148.39999390,742.40002441,82.40000153,0.00000000,0.00000000,129.99572754); //object(cs_landbit_30) (8) CreateObject(18319,-34.59999847,762.09997559,88.80000305,0.00000000,0.00000000,129.99572754); //object(cs_landbit_30) (8) CreateObject(18319,99.00000000,780.00000000,88.09999847,0.00000000,0.00000000,129.99572754); //object(cs_landbit_30) (8) CreateObject(18319,209.30000305,837.09997559,62.20000076,0.00000000,0.00000000,180.00000000); //object(cs_landbit_30) (8) CreateObject(18319,328.10000610,1023.40002441,47.90000153,0.00000000,0.00000000,200.00000000); //object(cs_landbit_30) (8) CreateObject(18319,365.00000000,1143.80004883,71.09999847,0.00000000,0.00000000,199.99511719); //object(cs_landbit_30) (8) CreateObject(18319,232.30000305,908.79998779,60.90000153,0.00000000,0.00000000,170.00000000); //object(cs_landbit_30) (8) CreateObject(18319,199.80000305,1270.80004883,78.80000305,0.00000000,0.00000000,260.00000000); //object(cs_landbit_30) (2) return 1; }
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmdtext,"/fc",true)==0) { new vehicleid = GetPlayerVehicleID(playerid); new State = GetPlayerState(playerid); if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER) { GameTextForPlayer(playerid,"",4000,6); LinkVehicleToInterior(vehicleid,0); SetPlayerInterior(playerid,0); return SetVehiclePos(vehicleid,-202.2190,1105.3522,19.7422); } SetPlayerPos(playerid,-202.2190,1105.3522,19.7422); SetPlayerInterior(playerid,0); return 1; } }//Warning 209
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { new arq[30]; format(arq,sizeof arq,"CONTAS/%s.ini",Nome(playerid)); if(dialogid == 1) { if(response == 1) { new regstring[130]; dini_Create(arq); SendClientMessage(playerid,0xFFFF47,"Sua conta foi registrada com sucesso! Logue-se no diбlogo abaixo."); format(regstring,sizeof(regstring),"{FAF0E6}Parabйns %s, vocк registrou sua conta.\nDigite sua senha abaixo para poder logar.",Nome(playerid)); ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{F5F5F5}Logar",regstring,"Logar","Sair"); dini_IntSet(arq,"Senha",strval(inputtext)); return 1; } SendClientMessage(playerid,0xFFFF00,"Vocк usou a opзгo 'Sair' e foi kickado pelo servidor!"); Kick(playerid); } else if(dialogid == 2) { if(response == 1) { if(dini_Int(arq,"Senha") == strval(inputtext)) { //Aqui coloca-se as variбveis do texto, como Level, dinheiro,etc. SendClientMessage(playerid,0xFFFF43,"Vocк logou no servidor com sucesso!"); Logado[playerid] = 1; return 1; } SendClientMessage(playerid,0xFFFF88,"Vocк digitou a senha incorretamente. Digite-a novamente."); ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{F5F5F5}Logar","Digite a senha corretamente.","Logar","Sair"); return 1; } SendClientMessage(playerid,0xFFFF00,"Vocк usou a opзгo 'Sair' e foi kickado pelo servidor!"); Kick(playerid); } return 1; } stock Nome(playerid) { new nome[MAX_PLAYER_NAME]; GetPlayerName(playerid, nome, sizeof(nome)); return nome; } return 1;//Error 010 }
Obrigado desde jб. (: