C:\Documents and Settings\Administrador\Desktop\GM\filterscripts\Ca sas.pwn(213) : error 017: undefined symbol "file" C:\Documents and Settings\Administrador\Desktop\GM\filterscripts\Ca sas.pwn(270) : error 017: undefined symbol "strtok" C:\Documents and Settings\Administrador\Desktop\GM\filterscripts\Ca sas.pwn(270) : error 033: array must be indexed (variable "tmp") C:\Documents and Settings\Administrador\Desktop\GM\filterscripts\Ca sas.pwn(276) : error 017: undefined symbol "strtok" C:\Documents and Settings\Administrador\Desktop\GM\filterscripts\Ca sas.pwn(276) : error 033: array must be indexed (variable "tmp") C:\Documents and Settings\Administrador\Desktop\GM\filterscripts\Ca sas.pwn(27 : error 017: undefined symbol "Casas" C:\Documents and Settings\Administrador\Desktop\GM\filterscripts\Ca sas.pwn(27 : error 017: undefined symbol "h" C:\Documents and Settings\Administrador\Desktop\GM\filterscripts\Ca sas.pwn(27 : error 029: invalid expression, assumed zero C:\Documents and Settings\Administrador\Desktop\GM\filterscripts\Ca sas.pwn(27 : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 9 Errors. |
new file[32];
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
#include <a_samp> //#include <Dini> #define MAX_CASAS 100 //Defina o mбximo de casas que vocк deseja ter aqui. #define FILTERSCRIPT new Text3D:HouseLabel[MAX_CASAS]; new gCasas; new CriandoCasa[MAX_PLAYERS]; new Float:CriandoCasaEX[MAX_PLAYERS],Float:CriandoCasaEY[MAX_PLAYERS],Float:CriandoCasaEZ[MAX_PLAYERS],Float:CriandoCasaSX[MAX_PLAYERS],Float:CriandoCasaSY[MAX_PLAYERS],Float:CriandoCasaSZ[MAX_PLAYERS]; new gPreco[MAX_PLAYERS]; enum cInfo { Float:cEntradax, Float:cEntraday, Float:cEntradaz, Float:cSaidax, Float:cSaiday, Float:cSaidaz, cDono[MAX_PLAYER_NAME], cNome[MAX_PLAYER_NAME], cPreco, cTranca, cComprada, cVW, cInterior, }; new Casas[MAX_CASAS][cInfo]; public OnFilterScriptInit() { print("[| Sistema de Casas por: LeLeTe, Versгo 1.0 CARREGADO! |]"); if(!fexist("LeLeTe.casas")) { new File:fhnd; fhnd=fopen("LeLeTe.casas",io_write); if (fhnd) { fclose(fhnd); return true; } } if(!fexist("numero.casas")) { new File:fhnd; fhnd=fopen("numero.casas",io_write); if (fhnd) { fclose(fhnd); return true; } } CarregarCasas(); for(new h = 0; h < sizeof(Casas); h++) { if(Casas[h][cComprada] == 0) { new Casa[128]; format(Casa, sizeof(Casa), "[CASA A VENDA]\n|Nome: %s |Preзo: R$%d|\n|Use /comprarcasa para comprar esta propriedade.|",Casas[h][cNome],Casas[h][cPreco]); HouseLabel[h] = Create3DTextLabel(Casa,0x006400FF,Casas[h][cEntradax], Casas[h][cEntraday], Casas[h][cEntradaz],60,0,1); AddStaticPickup(1273, 2, Casas[h][cEntradax], Casas[h][cEntraday], Casas[h][cEntradaz]); } if(Casas[h][cComprada] == 1) { new Casa2[128]; format(Casa2, sizeof(Casa2), "[CASA]\n|Nome: %s |\n\n|Dono: %s|\n|Aperte F para Entrar.|",Casas[h][cNome],Casas[h][cDono]); HouseLabel[h] = Create3DTextLabel(Casa2,0x006400FF,Casas[h][cEntradax], Casas[h][cEntraday], Casas[h][cEntradaz],60,0,1); AddStaticPickup(1318, 2, Casas[h][cEntradax], Casas[h][cEntraday], Casas[h][cEntradaz]); } } return 1; } public OnFilterScriptExit() { SalvarCasas(); print("[| Sistema de Casas por: LeLeTe, Versгo 1.0 DESCARREGADO! |]"); return 1; } CriarCasa(nome[MAX_PLAYER_NAME], Float:EntradaX, Float:EntradaY, Float:EntradaZ, Float:SaidaX, Float:SaidaY, Float:SaidaZ, preco, interior) { new h = gCasas; Casas[h][cEntradax] = EntradaX; Casas[h][cEntraday] = EntradaY; Casas[h][cEntradaz] = EntradaZ; Casas[h][cSaidax] = SaidaX; Casas[h][cSaiday] = SaidaY; Casas[h][cSaidaz] = SaidaZ; Casas[h][cNome] = nome; Casas[h][cPreco] = preco; Casas[h][cTranca] = 1; Casas[h][cComprada] = 0; Casas[h][cVW] = h; Casas[h][cInterior] = interior; new Casa[128]; format(Casa, sizeof(Casa), "[CASA A VENDA]\n[|Nome: %s |]\n[|Preзo: R$%d|]\n[|Use /comprarcasa para comprar esta propriedade.|]",Casas[h][cNome],Casas[h][cPreco]); HouseLabel[h] = Create3DTextLabel(Casa,0x006400FF,Casas[h][cEntradax], Casas[h][cEntraday], Casas[h][cEntradaz],60,0,1); AddStaticPickup(1273, 2, Casas[h][cEntradax], Casas[h][cEntraday], Casas[h][cEntradaz]); gCasas++; SalvarCasas(); return 1; } /*SalvarCasas() { new file[14] = "LeLeTe.casas"; dini_IntSet(file,"Casas",gCasas); new i; while(i < sizeof(Casas)) { new EntradaXS[MAX_CASAS][15]; format(EntradaXS[i], 15,"EntradaX%d", i); new EntradaYS[MAX_CASAS][15]; format(EntradaYS[i], 15,"EntradaY%d", i); new EntradaZS[MAX_CASAS][15]; format(EntradaZS[i], 15,"EntradaZ%d", i); new SaidaXS[MAX_CASAS][15]; format(SaidaXS[i], 15,"SaidaX%d", i); new SaidaYS[MAX_CASAS][15]; format(SaidaYS[i], 15,"SaidaY%d", i); new SaidaZS[MAX_CASAS][15]; format(SaidaZS[i], 15,"SaidaZ%d", i); new DonoS[MAX_CASAS][15]; format(DonoS[i], 15,"Dono%d", i); new NomeS[MAX_CASAS][15]; format(NomeS[i], 15,"Nome%d", i); new PrecoS[MAX_CASAS][15]; format(PrecoS[i], 15,"Preco%d", i); new TrancaS[MAX_CASAS][15]; format(TrancaS[i], 15,"Tranca%d", i); new CompradaS[MAX_CASAS][15]; format(CompradaS[i], 15,"Comprada%d", i); new VWS[MAX_CASAS][15]; format(VWS[i], 15,"VW%d", i); new InteriorS[MAX_CASAS][15]; format(InteriorS[i], 15,"Interior%d", i); dini_FloatSet(file, EntradaXS[i], Casas[i][cEntradax]); dini_FloatSet(file, EntradaYS[i], Casas[i][cEntraday]); dini_FloatSet(file, EntradaZS[i], Casas[i][cEntradaz]); dini_FloatSet(file, SaidaXS[i], Casas[i][cEntradax]); dini_FloatSet(file, SaidaYS[i], Casas[i][cEntraday]); dini_FloatSet(file, SaidaZS[i], Casas[i][cEntradaz]); dini_Set(file, DonoS[i], Casas[i][cDono]); dini_Set(file, NomeS[i], Casas[i][cNome]); dini_IntSet(file,PrecoS[i],Casas[i][cPreco]); dini_IntSet(file,TrancaS[i],Casas[i][cTranca]); dini_IntSet(file,CompradaS[i],Casas[i][cComprada]); dini_IntSet(file,VWS[i],Casas[i][cVW]); dini_IntSet(file,InteriorS[i],Casas[i][cInterior]); i++ } return 1; } CarregarCasas() { new file[14] = "LeLeTe.casas"; new i; gCasas = dini_Int(file,"Casas"); while(i < sizeof(Casas)) { new EntradaXS[MAX_CASAS][15]; format(EntradaXS[i], 15,"EntradaX%d", i); new EntradaYS[MAX_CASAS][15]; format(EntradaYS[i], 15,"EntradaY%d", i); new EntradaZS[MAX_CASAS][15]; format(EntradaZS[i], 15,"EntradaZ%d", i); new SaidaXS[MAX_CASAS][15]; format(SaidaXS[i], 15,"SaidaX%d", i); new SaidaYS[MAX_CASAS][15]; format(SaidaYS[i], 15,"SaidaY%d", i); new SaidaZS[MAX_CASAS][15]; format(SaidaZS[i], 15,"SaidaZ%d", i); new DonoS[MAX_CASAS][15]; format(DonoS[i], 15,"Dono%d", i); new NomeS[MAX_CASAS][15]; format(NomeS[i], 15,"Nome%d", i); new PrecoS[MAX_CASAS][15]; format(PrecoS[i], 15,"Preco%d", i); new TrancaS[MAX_CASAS][15]; format(TrancaS[i], 15,"Tranca%d", i); new CompradaS[MAX_CASAS][15]; format(CompradaS[i], 15,"Comprada%d", i); new VWS[MAX_CASAS][15]; format(VWS[i], 15,"VW%d", i); new InteriorS[MAX_CASAS][15]; format(InteriorS[i], 15,"Interior%d", i); Casas[i][cEntradax] = dini_Float(file, EntradaXS[i]); Casas[i][cEntraday] = dini_Float(file, EntradaYS[i]); Casas[i][cEntradaz] = dini_Float(file, EntradaZS[i]); Casas[i][cEntradax] = dini_Float(file, SaidaXS[i]); Casas[i][cEntraday] = dini_Float(file, SaidaYS[i]); Casas[i][cEntradaz] = dini_Float(file, SaidaZS[i]); strmid(Casas[i][cDono], dini_Get(file, DonoS[i]), 0, 20); strmid(Casas[i][cNome], dini_Get(file, NomeS[i]), 0, 20); Casas[i][cPreco] = dini_Int(file,PrecoS[i]); Casas[i][cTranca] = dini_Int(file,TrancaS[i]); Casas[i][cComprada] = dini_Int(file,CompradaS[i]); Casas[i][cVW] = dini_Int(file,VWS[i]); Casas[i][cInterior] = dini_Int(file,InteriorS[i]); i++ } return 1; }*/ stock split(const strsrc[], strdest[][], delimiter) { new i, li; new aNum; new len; while(i <= strlen(strsrc)){ if(strsrc[i]==delimiter || i==strlen(strsrc)){ len = strmid(strdest[aNum], strsrc, li, i, 12; strdest[aNum][len] = 0; li = i+1; aNum++; } i++; } return 1; } CarregarCasas() { new arrCoords[31][64]; new strFromFile2[256]; new strFromFile3[5]; new File: file = fopen("LeLeTe.casas", io_read); new File: file2 = fopen("numero.casas", io_read); fread(file2, strFromFile3); gCasas = strval(strFromFile3); if (file) { new idx; while (idx < sizeof(Casas)) { fread(file, strFromFile2); split(strFromFile2, arrCoords, ','); Casas[idx][cEntradax] = floatstr(arrCoords[0]); Casas[idx][cEntraday] = floatstr(arrCoords[1]); Casas[idx][cEntradaz] = floatstr(arrCoords[2]); Casas[idx][cSaidax] = floatstr(arrCoords[3]); Casas[idx][cSaiday] = floatstr(arrCoords[4]); Casas[idx][cSaidaz] = floatstr(arrCoords[5]); strmid(Casas[idx][cDono], arrCoords[6], 0, strlen(arrCoords[6]), 255); strmid(Casas[idx][cNome], arrCoords[7], 0, strlen(arrCoords[7]), 255); Casas[idx][cPreco] = strval(arrCoords[8]); Casas[idx][cInterior] = strval(arrCoords[9]); Casas[idx][cTranca] = strval(arrCoords[10]); Casas[idx][cComprada] = strval(arrCoords[11]); Casas[idx][cVW] = strval(arrCoords[12]); idx++; } fclose(file); } return 1; } SalvarCasas() { new idx; new File: file2; new File:file = fopen("numero.casas", io_write); new coordsstring[256]; format(coordsstring, sizeof(coordsstring), "%d", gCasas); fwrite(file, coordsstring); fclose(file); while (idx < sizeof(Casas)) { format(coordsstring, sizeof(coordsstring), "%f,%f,%f,%f,%f,%f,%s,%s,%d,%d,%d,%d,%d\r\n", Casas[idx][cEntradax], Casas[idx][cEntraday], Casas[idx][cEntradaz], Casas[idx][cSaidax], Casas[idx][cSaiday], Casas[idx][cSaidaz], Casas[idx][cDono], Casas[idx][cNome], Casas[idx][cPreco], Casas[idx][cInterior], Casas[idx][cTranca], Casas[idx][cComprada], Casas[idx][cVW]); if(idx == 0) { file2 = fopen("LeLeTe.casas", io_write); } else { file2 = fopen("LeLeTe.casas", io_append); } fwrite(file2, coordsstring); idx++; fclose(file2); } } stock PlayerToPoint(Float:radi, playerid, Float, Float:y, Float:z) { if(IsPlayerConnected(playerid)) { new Floatldposx, Floatldposy, Floatldposz; new Float:tempposx, Float:tempposy, Float:tempposz; GetPlayerPos(playerid, oldposx, oldposy, oldposz); tempposx = (oldposx -x); tempposy = (oldposy -y); tempposz = (oldposz -z); //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz); if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) { return 1; } } return 0; } CheckHouses(playerid) { for(new h = 0; h < sizeof(Casas); h++) { new Floatldposx, Floatldposy, Floatldposz; new playername[20], sendername[20]; GetPlayerName(playerid, playername, sizeof(playername)); GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerPos(playerid, oldposx, oldposy, oldposz); new nome[MAX_PLAYER_NAME]; GetPlayerName(playerid, nome, 20); if(strcmp(nome, Casas[h][cDono], true)) return SendClientMessage(playerid, 0xFFFFFFFF, " Vocк jб tem uma casa !"); if(PlayerToPoint(15, playerid, Casas[h][cEntradax], Casas[h][cEntraday], Casas[h][cEntradaz])) { if(GetPlayerMoney(playerid) > Casas[h][cPreco]) { Casas[h][cComprada] = 1; GetPlayerName(playerid, sendername, sizeof(sendername)); strmid(Casas[h][cDono], sendername, 0, strlen(sendername), 255); GivePlayerMoney(playerid,-Casas[h][cPreco]); SetPlayerInterior(playerid,Casas[h][cInterior]); SetPlayerPos(playerid,Casas[h][cSaidax],Casas[h][cSaiday],Casas[h][cSaidaz]); GameTextForPlayer(playerid, "~w~Bem vindo a sua nova casa!~n~Para sair, aperte ~p~F~w~ na porta de saida!", 5000, 3); SalvarCasas(); new Casa2[128]; format(Casa2, sizeof(Casa2), "[CASA]\n|Nome: %s |\n\n|Dono: %s|\n|Aperte F para Entrar.|",Casas[h][cNome],Casas[h][cDono]); Update3DTextLabelText(HouseLabel[h],0x006400FF, Casa2); } else { SendClientMessage(playerid, 0xFFFFFFFF, " Vocк nгo tem dinheiro o suficiente !"); } } else return SendClientMessage(playerid, 0xFFFFFFFF, " Vocк nгo estб perto de uma casa !"); } return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmdtext, "/abrirporta", true) == 0) { for(new h = 0; h < sizeof(Casas); h++) { new nome[MAX_PLAYER_NAME]; GetPlayerName(playerid, nome, 20); if(strcmp(nome, Casas[h][cDono], true)) { if(Casas[h][cTranca]) { Casas[h][cTranca] = 0; return SendClientMessage(playerid, 0xFFFFFFFF, " Vocк destrancou sua casa !"); } else { Casas[h][cTranca] = 1; return SendClientMessage(playerid, 0xFFFFFFFF, " Vocк trancou sua casa !"); } } else return SendClientMessage(playerid, 0xFFFFFFFF, " Vocк nгo tem uma casa !"); } } if(strcmp(cmdtext, "/criarcasa", true) == 0) { if(IsPlayerAdmin(playerid)) { if(CriandoCasa[playerid] == 1 || CriandoCasa[playerid] == 0) { GetPlayerPos(playerid, CriandoCasaEX[playerid],CriandoCasaEY[playerid],CriandoCasaEZ[playerid]); CriandoCasa[playerid] = 2; return SendClientMessage(playerid, 0xFFFFFFFF, "Vocк comeзou a criar uma casa! Vб atй a porta de saнda e digite /criarcasa de novo!"); } else if(CriandoCasa[playerid] == 2) { GetPlayerPos(playerid, CriandoCasaSX[playerid],CriandoCasaSY[playerid],CriandoCasaSZ[playerid]); CriandoCasa[playerid] = 1; ShowPlayerDialog(playerid, 900, DIALOG_STYLE_INPUT, "Valor", "Digite abaixo o valor (preзo) da casa.", "Ok", "Cancelar"); return SendClientMessage(playerid, 0xFFFFFFFF, "Vocк acaba de setar a saida da casa!"); } } return 1; } if(strcmp(cmdtext, "/entrar", true) == 0) { for(new i = 0; i < sizeof(Casas); i++) { if (PlayerToPoint(3, playerid,Casas[i][cEntradax], Casas[i][cEntraday], Casas[i][cEntradaz])) { if(Casas[i][cTranca] == 0) { SetPlayerInterior(playerid,Casas[i][cInterior]); SetPlayerVirtualWorld(playerid, Casas[i][cVW]); SetPlayerPos(playerid,Casas[i][cSaidax], Casas[i][cSaiday], Casas[i][cSaidaz]); GameTextForPlayer(playerid, "~w~Bem vindo em casa", 5000, 1); } else { GameTextForPlayer(playerid, "~r~Fechado", 5000, 1); } } } return 1; } if(strcmp(cmdtext, "/sair", true) == 0) { for(new i = 0; i < sizeof(Casas); i++) { if (PlayerToPoint(3, playerid,Casas[i][cSaidax], Casas[i][cSaiday], Casas[i][cSaidaz])) { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,Casas[i][cEntradax],Casas[i][cEntraday],Casas[i][cEntradaz]); SetPlayerVirtualWorld(playerid, 0); } } } if(strcmp(cmdtext, "/comprarcasa", true) == 0) { CheckHouses(playerid); return 1; } return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(IsPlayerConnected(playerid)) { if(dialogid == 900) { if(!response) return 1; else { new valor = strval(inputtext); gPreco[playerid] = valor; ShowPlayerDialog(playerid, 901, DIALOG_STYLE_INPUT, "Nome", "Digite o nome abaixo da casa.", "Ok", "Voltar"); return 1; } } if(dialogid == 901) { if(!response) return ShowPlayerDialog(playerid, 900, DIALOG_STYLE_INPUT, "Valor", "Digite abaixo o valor (preзo) da casa.", "Ok", "Cancelar"); else { new nome[MAX_PLAYER_NAME]; strmid(nome, inputtext, 0, 255, MAX_PLAYER_NAME-1); CriarCasa(nome, CriandoCasaEX[playerid],CriandoCasaEY[playerid],CriandoCasaEZ[playerid], CriandoCasaSX[playerid],CriandoCasaSY[playerid],CriandoCasaSZ[playerid], gPreco[playerid], GetPlayerInterior(playerid)); SendClientMessage(playerid, 0xFFFFFFFF, "Casa criada com sucesso!"); return 1; } } } return 1; } public OnPlayerKeyStateChange(playerid,newkeys,oldkeys) { if(newkeys == 16 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) { OnPlayerCommandText(playerid,"/entrar"); OnPlayerCommandText(playerid,"/sair"); } return 0; } public OnPlayerConnect(playerid) { SendClientMessage(playerid, 0x8000FFAA, "Este server usa o Sistema de Casas por: LeLeTe!"); return 1; } |