View crop_str.pwn
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
stock crop_string(const input_str[], output_str[], const length = 60, const size = sizeof(output_str)) | |
{ | |
new | |
buffer[1024], | |
i = 0, | |
j = 0; | |
while (input_str[i] != '\0') { | |
if (i % length == 0) { | |
buffer[j] = '\n'; |
View ReturnRandomSymbol.pwn
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
stock ReturnRandomSymbol(bool:uppercase = true, bool:lowercase = true) | |
{ | |
new value = -1; | |
if (uppercase && lowercase) { | |
value = random(2); | |
} | |
if (uppercase && (value == 0 || value == -1)) { | |
value = mathrandom('A', 'Z'); |
View GetCoordsBefore.pwn
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
stock GetCoordsBefore(Float:x, Float:y, Float:a, Float:distance, &Float:res_x, &Float:res_y) | |
{ | |
res_x = x + (distance * floatsin(-a, degrees)); | |
res_y = y + (distance * floatcos(-a, degrees)); | |
} |
View floatsuperround.pwn
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
stock Float:floatsuperround(Float:value, count) | |
{ | |
new | |
Float:intpart = float(floatround(value, floatround_tozero)), | |
Float:fractpart = floatfract(value) * float(pow(10, floatfractlength(value))); | |
return intpart + fractpart / float(pow(10, count)); | |
} | |
stock pow(value, degree) |
View remove_spaces.pwn
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
#include <a_samp> | |
/* | |
Consts | |
*/ | |
#define TESTING_STRING " oc, ococ,ococ,ococ,oc oc,ococ,ococ,ococ,ococ,ococ,oco" | |
#define RESULT_STRING "oc,ococ,ococ,ococ,ococ,ococ,ococ,ococ,ococ,ococ,oco" | |
const PROFILE_ITERATIONS_MAJOR = 1000; |
View example.php
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
<?php | |
inculde 'oop_config.php'; | |
echo Config::get()->site->path; | |
// result: some_path/ | |
$cfg = new Config; | |
echo $cfg->site->path; | |
// result: some_path/ |
View GetWeekName.pwn
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
enum WeekLang { | |
WEEK_LANG_ENGLISH, | |
WEEK_LANG_RUSSIAN, | |
} | |
static const | |
gDaysOfWeek[WeekLang][][] = { | |
{ | |
!"Thursday", | |
!"Friday", |
View cmd_id.pwn
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
CMD:id(playerid, params[]) | |
{ | |
#if !defined COMMAND_ID_MAX_MATCHES | |
#define COMMAND_ID_MAX_MATCHES 10 | |
#endif | |
new | |
ids[COMMAND_ID_MAX_MATCHES]; | |
if (sscanf(params, "?<MATCH_NAME_PARTIAL=1>u[" #COMMAND_ID_MAX_MATCHES "]", ids)) { |
View fix_getvpcd.pwn
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
/* | |
About: GetVehicleParamsCarDoors fix (beta) | |
Author: ziggi | |
*/ | |
#if !defined _samp_included | |
#error Include a_samp.inc first | |
#endif |
View orgsys.pwn
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
#include <a_samp> | |
#define ORGANIZATION_MAX_NAME 32 | |
#define ORGANIZATION_MAX_RANK_NAME 32 | |
enum { | |
ORGANIZATION_NONE, | |
ORGANIZATION_LSPD, | |
ORGANIZATION_FBI, | |
ORGANIZATION_AVIA, |
OlderNewer