PHP код:
|
// Topo
new Neve[MAX_PLAYERS];
new Float:XYZ[3];
// Em OnPlayerUpdate ou em algum timer de 1/2seg.
for(new i; i<MAX_PLAYERS; ++i) {
GetPlayerPos(i, XYZ[0], XYZ[1], XYZ[2]);
SetDynamicObjectPos(Neve[i], XYZ[0] + random(25), XYZ[1] + random(25), XYZ[2] - 5 + random(10));
}
// Final do GameMode
stock CriarNeve(playerid)
{
GetPlayerPos(playerid, XYZ[0], XYZ[1], XYZ[2]);
Neve[playerid] = CreateDynamicObject(18864, XYZ[0] + random(25), XYZ[1] + random (25), XYZ[2] - 5 + random(10), random(280), random(280), 0, -1, -1, playerid);
return true;
}
stock DeletarNeve(playerid)
return DestroyDynamicObject(Neve[playerid]);
Bem, tirei a base de um FS para pegar o objeto de algum lugar em 2014 que nem lembro mais.
Sistema de Neve simples que 'segue o player'. PHP код:
|
// Topo GM
forward CheckHack();
new HackOxygen[MAX_PLAYERS];
// Dentro da public OnPlayerConnect
HackOxygen[playerid] = 0;
// Dentro da public OnGameModeInit
SetTimer("CheckHack", 3500, true);
// Final do GM fora de qualquer funзгo ou Public
public CheckHack()
{
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)//MAX_PLAYERS
{
if(IsPlayerConnected(i))
{
new Float:pos[3];
GetPlayerPos(i, pos[0], pos[1], pos[2]);
if (pos[2]<-2.0 && IsPlayerInWater(i)) { if(HackOxygen[i] < 9){ HackOxygen[i]++; } }
if (pos[2]>=0.0) { if(HackOxygen[i] > 0){ HackOxygen[i]--; } }
if(HackOxygen[i] >= 9)
{
SendClientMessage(i, -1, "ANTICHEAT: Vocк estб usando Oxigкnio infinito ! ! !");
SetPlayerPos(i,pos[0], pos[1],0.05);
}
}
}
return 1;
}
stock IsPlayerInWaterLocation(playerid)
{
static Float:fX, Float:fY, Float:fZ; GetPlayerPos(playerid, fX, fY, fZ);
if((fX >= 2044.6 && fX <= 2192.984 && fY >= 1206.358 && fY <= 1376.552) && fZ < 0xA) return 1;
else if((fX >= 2048.504 && fX <= 2185.174 && fY >= 1063.239 && fY <= 1202.49) && fZ < 0xA) return 1;
else if((fX >= 2204.698 && fX <= 2204.698 && fY >= 1426.837 && fY <= 1430.705) && fZ < 0xA) return 1;
else if((fX >= 2032.885 && fX <= 2114.887 && fY >= 1852.325 && fY <= 1991.575) && fZ < 0xC) return 1;
else if((fX >= 2517.086 && fX <= 2606.897 && fY >= 2316.493 && fY <= 2420.93) && fZ < 0x16) return 1;
else if((fX >= 2554.5996 && fX <= 2507.7683 && fY >= 1548.6178 && fY <= 1588.9154) && fZ < 0xF) return 1;
else if((fX >= -2043.628 && fX <= -1973.561 && fY >= -980.9415 && fY <= -724.0283) && fZ < 0x20) return 1;
else if((fX >= -2753.912 && fX <= -2665.071 && fY >= -522.3632 && fY <= -380.3444) && fZ < 0x05) return 1;
else if((fX >= 1219.864 && fX <= 1292.118 && fY >= -2435.881 && fY <= -2325.344) && fZ < 0xF) return 1;
else if((fX >= 1923.388 && fX <= 2010.854 && fY >= -1223.924 && fY <= -1168.656) && fZ < 0x16) return 1;
else if((fX >= 1269.301 && fX <= 1314.935 && fY >= -837.0452 && fY <= -781.7769) && fZ < 0x5A) return 1;
else if((fX >= 1087.3953 && fX <= 1102.3138 && fY >= -682.6734 && fY <= -663.0043) && fZ < 0x71) return 1;
else if((fX >= 1268.6118 && fX <= 1291.8774 && fY >= -784.2910 && fY <= -764.6104) && fZ < 0x43D) return 1;
else if(fZ < 0xF) return 1;
return 0;
}
stock IsPlayerUsingSwimAnim(playerid)
{
if(IsPlayerInAnyVehicle(playerid) || GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return 0;
static animlib[32], animname[32];
GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
if(!strcmp(animlib, "SWIM", true) && !strcmp(animname, "SWIM_GLIDE", true)) return 1;
else if(!strcmp(animlib, "SWIM", true) && !strcmp(animname, "SWIM_BREAST", true)) return 1;
else if(!strcmp(animlib, "SWIM", true) && !strcmp(animname, "SWIM_CRAWL", true)) return 1;
else if(!strcmp(animlib, "SWIM", true) && !strcmp(animname, "SWIM_DIVE_UNDER", true)) return 1;
else if(!strcmp(animlib, "SWIM", true) && !strcmp(animname, "SWIM_DIVE_GLIDE", true)) return 1;
else if(!strcmp(animlib, "SWIM", true) && !strcmp(animname, "SWIM_UNDER", true)) return 1;
else if(!strcmp(animlib, "SWIM", true) && !strcmp(animname, "SWIM_TREAD", true)) return 1;
return 0;
}
stock IsPlayerInWater(playerid)
{
if(IsPlayerInWaterLocation(playerid) && IsPlayerUsingSwimAnim(playerid))
{
return 1;
}
return 0;
}
Detect Oxigкnio infinito
PHP код:
|
@zSuYaNw isso ai gera realmente uma palavra ou uma string aleatуria?
|
#define _fraseado "patinhos\nForam passear\nAlйm das montanhas\nPara brincar\nA mamгe gritou\nQuack quack quack\nMas sу quatro patinhos\nVoltaram de lб"
print("\n\n\n");
for(new i = 5; i != 0; --i){
printf("%d %s\n\n", i, _fraseado);
}
print(#A mamгe patinha\nFoi procurar\nAlйm das montanhas\nNa beira do mar\nA mamгe gritou\nQuack quack quack\nE os cinco patinhos\nVoltaram de lб);
stock Rank(Scor[], Top[], size, size2) { new scortp; for(new tp = 0; tp < size2; tp++) { scortp = 0; for(new sp = 0; sp < size; sp++) { if(tp == 0) { if(Scor[sp] > scortp) { Top[tp] = sp; scortp = Scor[sp]; } } else { if(Scor[sp] > scortp) { if(Scor[sp] < Scor[Top[tp-1]]) { Top[tp] = sp; scortp = Scor[sp]; } } } } } return 1; }
#include <a_samp> #include <zcmd> CMD:rank(playerid) { new Scor[MAX_PLAYERS], Top[10], str[600], name[MAX_PLAYER_NAME]; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) Scor[i] = GetPlayerScore(i); } Rank(Scor, Top, sizeof(Scor), sizeof(Top)); for(new i = 0; i < 10; i++) { GetPlayerName(Top[i], name, sizeof(name)); format(str, sizeof(str), "%s\n%02dє - %s (%i) - %d scores", str, i+1, name, Top[i], Scor[Top[i]]); } ShowPlayerDialog(playerid, 2131, DIALOG_STYLE_MSGBOX, "Rank", str, "Fechar", ""); return 1; }
changePlayerPos(playerid, Float:X, Float:Y, Float:Z, Float:A = 0.0, bool:vehicle = false, interior = 0, virtualworld = 0)
{
if(GetPlayerState(playerid) == 2 && vehicle == true) {
SetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z);
if(A != 0.0)
SetVehicleZAngle(GetPlayerVehicleID(playerid), A);
if(interior != 0) {
SetPlayerInterior(playerid, interior);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), interior);
}
if(virtualworld != 0) {
SetPlayerVirtualWorld(playerid, virtualworld);
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), virtualworld);
}
}
else {
SetPlayerPos(playerid, X, Y, Z);
if(A != 0.0)
SetPlayerFacingAngle(playerid, A);
if(interior != 0)
SetPlayerInterior(playerid, interior);
if(virtualworld != 0)
SetPlayerVirtualWorld(playerid, virtualworld);
}
}
// de maiъscula para minъscula
stock new_tolower(c) {
switch(c) {
case 'Т': return 'т';
case 'Х': return 'х';
case 'У': return 'у';
case 'Г': return 'г';
case 'Б': return 'б';
case 'А': return 'а';
case 'З': return 'з';
case 'Ъ': return 'ъ';
case 'Щ': return 'щ';
case 'Ф': return 'ф';
case 'Ы': return 'ы';
case 'К': return 'к';
case 'Й': return 'й';
case 'И': return 'и';
case 'М': return 'м';
case 'Н': return 'н';
case 'В': return 'в';
case 'С': return 'с';
case 'О': return 'о';
}
return tolower(c);
}
stock convert_minusculas(string[]) {
for(new i; i < strlen(string); i++)
string[i] = new_tolower(string[i]);
return string;
}
// de minъscula para maiъscula
stock new_toupper(c) {
switch(c) {
case 'у': return 'У';
case 'т': return 'Т';
case 'х': return 'Х';
case 'ф': return 'Ф';
case 'г': return 'Г';
case 'б': return 'Б';
case 'а': return 'А';
case 'в': return 'В';
case 'з': return 'З';
case 'ъ': return 'Ъ';
case 'щ': return 'Щ';
case 'ы': return 'Ы';
case 'к': return 'К';
case 'й': return 'Й';
case 'и': return 'И';
case 'о': return 'О';
case 'н': return 'Н';
case 'м': return 'М';
case 'с': return 'С';
}
return toupper(c);
}
stock convert_maiusculas(string[]) {
for(new i; i < strlen(string); i++)
string[i] = new_toupper(string[i]);
return string;
}
public OnPlayerText(playerid, text[]) {
static Name[24], Msg[144];
GetPlayerName(playerid, Name, 24);
format(Msg, 144, "%s [%i]: %s", Name, playerid, convert_minusculas(text)); // convertendo todo o texto para minusculo
SendClientMessageToAll(GetPlayerColor(playerid), Msg);
return 0;
}
Nem todos os caracteres maiъsculos sгo convertidos em minъsculos. Isto irб resolver nos demais casos, e uma outra funзгo jб para converter uma string inteira.
PHP Code:
PHP Code:
|
CONEXГO AЗAН
conexГo aЗaН
[10:39:10] ▒▒▒▒▒▒▒▒▒ [10:39:10] ▒▒▒▒▒▒▒▒▒
[10:34:00] бйнуъзсгх [10:34:00] БЙНУЪЗСГХ
[chat] [Locky]: CONEXГO PROBLEMБTICA
[chat] [Locky]: CONEXГO PROBLEMБTICA MIGГO
Cуdigo simples para gerar nъmero de telefones com prefixos das operadores TIM e CLARO.
PHP код:
Код:
[03:18:18] [TIM 1]: 99775736 [03:18:18] [TIM 2]: 99150535 [03:18:18] [TIM 3]: 99208176 [03:18:18] [CLARO 1]: 94233012 [03:18:18] [CLARO 2]: 94300513 [03:18:18] [CLARO 3]: 94427561 |
TIM: 981 Claro: 992/993 Vivo: 999/998 Oi: 988
Nгo seria totalmente funcional... pois varia de cada regiгo, e alйm disto as pessoas podem mudar de operadora sem trocar de nъmero.
Aqui na minha regiгo por ex: Код:
TIM: 981 Claro: 992/993 Vivo: 999/998 Oi: 988 |
#include a_http
public OnGameModeInit()
{
HTTP(1003, HTTP_GET, "link(pastebin)", "", "Sua_Public"); //Link exemplo: pastebin.com/raw/5DxFYapP (USE O /raw/)
return 1;
}
forward Sua_Public(index, response_code, data[]);
public Sua_Public(index, response_code, data[])
{
if(response_code == 200)
{
print("Parabens voce tem autorizaзгo para usar o Script ");
}
else
{
print("Sem Conexгo com a internet/link off");
SendRconCommand("exit");//desligar o server caso nao tenha conexao com internet
}
if(strfind(data, "sim", true) != -1) // "sim" й o texto que vai estar no link do pastebin
{
}
else
{
SendRconCommand("exit");// caso no link nao tiver a palavra "sim" o sv vai desligar
}
return 1;
}
__date = irб mostrar a data __time = irб mostrar a hora __file = irб mostrar o arquivo
public OnFilterScriptInit() {
printf("Compilaзгo: %s %s", __date, __time);
}
Compilaзгo: 25 Apr 2017 23:58:41
public OnFilterScriptInit()
{
new bd[6];
unformat(__date, "dk<mes>d", bd[0], bd[1], bd[2]);
unformat(__time, "p<:>ddd", bd[3],bd[4],bd[5]);
printf("%02d/%02d/%d em %02d:%02d:%02d", bd[0], bd[1], bd[2], bd[3], bd[4], bd[5]);
}
SSCANF:mes(string[]) {
if(!strcmp(string, "Jan", true)) return 1;
if(!strcmp(string, "Fev", true)) return 2;
if(!strcmp(string, "Mar", true)) return 3;
if(!strcmp(string, "Apr", true)) return 4;
if(!strcmp(string, "May", true)) return 5;
if(!strcmp(string, "Jun", true)) return 6;
if(!strcmp(string, "Jul", true)) return 7;
if(!strcmp(string, "Aug", true)) return 8;
if(!strcmp(string, "Sep", true)) return 9;
if(!strcmp(string, "Oct", true)) return 10;
if(!strcmp(string, "Nov", true)) return 11;
if(!strcmp(string, "Dez", true)) return 12;
return -1;
}
25/04/2017 em 23:58:41