-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1c3672e
Showing
179 changed files
with
128,222 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Kod �r�d�owy oprogramowania na platformie SA-MP do projektu mySantos | ||
|
||
- korzysta z MySQL | ||
- posiada kilka b��d�w przy printowaniu do konsoli (server_log.txt zasypuje si� errorami) | ||
- rozwijany 30.11.2013 - 18.03.2014 | ||
- pisany ca�kowicie od zera |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,199 @@ | ||
/* | ||
* Dini 1.5.1 | ||
* (c) Copyright 2006 by DracoBlue | ||
* | ||
* @author : DracoBlue (http://dracoblue.com) | ||
* @date : 13th May 2006 | ||
* @update : 3rd June 2007 | ||
* @require : DUtils 1.8 | ||
* | ||
* This file is provided as is (no warranties). | ||
* | ||
* Feel free to use it, a little message in | ||
* about box is honouring thing, isn't it? | ||
* | ||
*/ | ||
|
||
#if defined _dini_included | ||
#endinput | ||
#endif | ||
|
||
#define _dini_included | ||
#pragma library dutils | ||
|
||
#include <dutils> | ||
|
||
stock dini_Exists(filename[]) { | ||
if (fexist(filename)) return true; | ||
return false; | ||
} | ||
|
||
stock dini_Remove(filename[]) { | ||
if (!fexist(filename)) return false; | ||
fremove(filename); | ||
return true; | ||
} | ||
|
||
stock dini_Create(filename[]) { | ||
new File:fhnd; | ||
if (fexist(filename)) return false; | ||
fhnd=fopen(filename,io_write); | ||
fclose(fhnd); | ||
return true; | ||
} | ||
|
||
stock dini_PRIVATE_ExtractKey(line[]) { | ||
new tmp[MAX_STRING]; | ||
tmp[0]=0; | ||
if (strfind(line,"=",true)==-1) return tmp; | ||
set(tmp,strlower(ret_memcpy(line,0,strfind(line,"=",true)))); | ||
return tmp; | ||
} | ||
|
||
stock dini_PRIVATE_ExtractValue(line[]) { | ||
new tmp[MAX_STRING]; | ||
tmp[0]=0; | ||
if (strfind(line,"=",true)==-1) { | ||
return tmp; | ||
} | ||
set(tmp,ret_memcpy(line,strfind(line,"=",true)+1,strlen(line))); | ||
return tmp; | ||
} | ||
|
||
stock dini_Set(filename[],key[],value[]) { | ||
new File:fohnd, File:fwhnd; | ||
new bool:wasset=false; | ||
new tmpres[MAX_STRING]; | ||
if (key[0]==0) return false; /* If we have no sign in key, it can't be set*/ | ||
format(tmpres,sizeof(tmpres),"%s.part",filename); | ||
fohnd=fopen(filename,io_read); | ||
if (!fohnd) return false; | ||
fremove(tmpres); | ||
fwhnd=fopen(tmpres,io_write); | ||
// if (!fwhnd) return false; | ||
while (fread(fohnd,tmpres)) { | ||
StripNewLine(tmpres); | ||
if ((!wasset)&&(equal(dini_PRIVATE_ExtractKey(tmpres),key,true))) { | ||
/* We've got what needs to be replaced! */ | ||
format(tmpres,sizeof(tmpres),"%s=%s",key,value); | ||
wasset=true; | ||
} | ||
fwrite(fwhnd,tmpres); | ||
fwrite(fwhnd,"\r\n"); | ||
} | ||
|
||
if (!wasset) { | ||
format(tmpres,sizeof(tmpres),"%s=%s",key,value); | ||
fwrite(fwhnd,tmpres); | ||
fwrite(fwhnd,"\r\n"); | ||
} | ||
|
||
fclose(fohnd); | ||
fclose(fwhnd); | ||
|
||
format(tmpres,sizeof(tmpres),"%s.part",filename); | ||
if (fcopytextfile(tmpres,filename)) { | ||
return fremove(tmpres); | ||
} | ||
return false; | ||
} | ||
|
||
|
||
stock dini_IntSet(filename[],key[],value) { | ||
new valuestring[MAX_STRING]; | ||
format(valuestring,sizeof(valuestring),"%d",value); | ||
return dini_Set(filename,key,valuestring); | ||
} | ||
|
||
stock dini_Int(filename[],key[]) { | ||
return strval(dini_Get(filename,key)); | ||
} | ||
|
||
stock dini_FloatSet(filename[],key[],Float:value) { | ||
new valuestring[MAX_STRING]; | ||
format(valuestring,sizeof(valuestring),"%f",value); | ||
return dini_Set(filename,key,valuestring); | ||
} | ||
|
||
stock Float:dini_Float(filename[],key[]) { | ||
return floatstr(dini_Get(filename,key)); | ||
} | ||
|
||
stock dini_Bool(filename[],key[]) { | ||
return strval(dini_Get(filename,key)); | ||
} | ||
|
||
stock dini_BoolSet(filename[],key[],value) { | ||
new valuestring[MAX_STRING]; | ||
format(valuestring,sizeof(valuestring),"%d",value); | ||
return dini_Set(filename,key,valuestring); | ||
} | ||
|
||
stock dini_Unset(filename[],key[]) { | ||
new File:fohnd, File:fwhnd; | ||
new tmpres[MAX_STRING]; | ||
format(tmpres,sizeof(tmpres),"%s.part",filename); | ||
fohnd=fopen(filename,io_read); | ||
if (!fohnd) return false; | ||
fremove(tmpres); | ||
fwhnd=fopen(tmpres,io_write); | ||
// if (!fwhnd) return false; | ||
while (fread(fohnd,tmpres)) { | ||
StripNewLine(tmpres); | ||
if (equal(dini_PRIVATE_ExtractKey(tmpres),key,true)) { | ||
/* We've got what needs to be removed! */ | ||
} else { | ||
format(tmpres,sizeof(tmpres),"%s",tmpres); | ||
fwrite(fwhnd,tmpres); | ||
fwrite(fwhnd,"\r\n"); | ||
} | ||
} | ||
|
||
fclose(fohnd); | ||
fclose(fwhnd); | ||
|
||
format(tmpres,sizeof(tmpres),"%s.part",filename); | ||
if (fcopytextfile(tmpres,filename)) { | ||
return fremove(tmpres); | ||
} | ||
return false; | ||
} | ||
|
||
stock dini_Get(filename[],key[]) { | ||
new File:fohnd; | ||
new tmpres[MAX_STRING]; | ||
new tmpres2[MAX_STRING]; | ||
tmpres[0]=0; | ||
fohnd=fopen(filename,io_read); | ||
if (!fohnd) return tmpres; | ||
while (fread(fohnd,tmpres)) { | ||
StripNewLine(tmpres); | ||
if (equal(dini_PRIVATE_ExtractKey(tmpres),key,true)) { | ||
/* We've got what we need */ | ||
tmpres2[0]=0; | ||
strcat(tmpres2,dini_PRIVATE_ExtractValue(tmpres)); | ||
fclose(fohnd); | ||
return tmpres2; | ||
} | ||
} | ||
fclose(fohnd); | ||
return tmpres; | ||
} | ||
|
||
|
||
stock dini_Isset(filename[],key[]) { | ||
new File:fohnd; | ||
new tmpres[MAX_STRING]; | ||
fohnd=fopen(filename,io_read); | ||
if (!fohnd) return false; | ||
while (fread(fohnd,tmpres)) { | ||
StripNewLine(tmpres); | ||
if (equal(dini_PRIVATE_ExtractKey(tmpres),key,true)) { | ||
/* We've got what we need */ | ||
fclose(fohnd); | ||
return true; | ||
} | ||
} | ||
fclose(fohnd); | ||
return false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
FileFunctions Plugin v0.1b (by RyDeR`) | ||
*/ | ||
|
||
#if defined _INC_FileFunctions | ||
#endinput | ||
#else | ||
#define _INC_FileFunctions | ||
#endif | ||
|
||
enum io_FileMode | ||
{ | ||
io_Read, | ||
io_Write, | ||
io_Append, | ||
io_ReadWrite, | ||
io_EmptyReadWrite, | ||
io_ReadAppend | ||
}; | ||
|
||
enum seek_Origin | ||
{ | ||
seek_Start, | ||
seek_Current, | ||
seek_End | ||
}; | ||
|
||
native File: fileOpen(const fileName[], io_FileMode: fileMode); | ||
native File: fileReOpen(File: handle, const fileName[], io_FileMode: fileMode); | ||
native fileClose(File: handle); | ||
native fileRemove(const fileName[]); | ||
native fileExists(const fileName[]); | ||
native fileMove(const currentFilePath[], const newFilePath[]); | ||
native fileRewind(File: handle); | ||
native fileWrite(File: handle, const string[]); | ||
native fileRead(File: handle, buffer[], const size = sizeof(buffer)); | ||
native filePutChar(File: handle, value); | ||
native fileGetChar(File: handle); | ||
native fileSeek(File: handle, position, seek_Origin: origin); | ||
native fileLength(File: handle); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Include pretty much 90% of YSI in one fell swoop! | ||
|
||
loadtext core[ysi_langs]; | ||
|
||
YCMD:language(playerid, params[], help) | ||
{ | ||
if (help) | ||
{ | ||
Text_Send(playerid, $YSI_LANGS_HELP); | ||
} | ||
else | ||
{ | ||
new | ||
lang; | ||
if (sscanf(params, "i", lang)) | ||
{ | ||
new | ||
c = _:Langs_GetLanguageCount(), | ||
Language:i = Language:0; | ||
while (c) | ||
{ | ||
new | ||
code[3]; | ||
strcpy(code, Langs_GetCode(i)); | ||
if (!isnull(code)) | ||
{ | ||
// They may not be in order. | ||
Text_Send(playerid, $YSI_LANGS_DISP, _:i, Langs_GetName(i), code); | ||
--c; | ||
} | ||
++i; | ||
} | ||
Text_Send(playerid, $YSI_LANGS_SET, YCMD:language); | ||
} | ||
else if (Langs_SetPlayerLanguage(playerid, Language:lang) == NO_LANGUAGE) | ||
{ | ||
Text_Send(playerid, $YSI_LANGS_INV); | ||
} | ||
else | ||
{ | ||
Text_Send(playerid, $YSI_LANGS_DONE, lang, Langs_GetName(Language:lang)); | ||
} | ||
} | ||
return 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Include pretty much 90% of YSI in one fell swoop! | ||
|
||
loadtext core[ysi_commands], core[ysi_help]; | ||
|
||
YCMD:commands(playerid, params[], help) | ||
{ | ||
if (help) | ||
{ | ||
Text_Send(playerid, $YSI_COMM_HELP); | ||
} | ||
else | ||
{ | ||
new | ||
count = Command_GetPlayerCommandCount(playerid); | ||
for (new i = 0; i != count; ++i) | ||
{ | ||
Text_Send(playerid, $YSI_COMM_LIST, Command_GetNext(i, playerid)); | ||
} | ||
} | ||
return 1; | ||
} | ||
|
||
YCMD:help(playerid, params[], help) | ||
{ | ||
if (help) | ||
{ | ||
Text_Send(playerid, $YSI_HELP); | ||
} | ||
else | ||
{ | ||
if (isnull(params)) | ||
{ | ||
Text_Send(playerid, $YSI_HELP); | ||
} | ||
else | ||
{ | ||
Command_ReProcess(playerid, params, true); | ||
} | ||
} | ||
return 1; | ||
} |
Oops, something went wrong.