Jump to content

3xTaSY

Membru
  • Posts

    83
  • Joined

  • Last visited

    Never

Everything posted by 3xTaSY

  1. Tot 5 erori primesc. C:\Users\Bogdan\Desktop\eXtreme Stunt Devil v5\filterscripts\rcon_cmds.pwn(39) : error 075: input line too long (after substitutions) C:\Users\Bogdan\Desktop\eXtreme Stunt Devil v5\filterscripts\rcon_cmds.pwn(40) : error 037: invalid string (possibly non-terminated string) C:\Users\Bogdan\Desktop\eXtreme Stunt Devil v5\filterscripts\rcon_cmds.pwn(40) : error 017: undefined symbol "FF0000" C:\Users\Bogdan\Desktop\eXtreme Stunt Devil v5\filterscripts\rcon_cmds.pwn(40) : warning 217: loose indentation C:\Users\Bogdan\Desktop\eXtreme Stunt Devil v5\filterscripts\rcon_cmds.pwn(40) : error 029: invalid expression, assumed zero C:\Users\Bogdan\Desktop\eXtreme Stunt Devil v5\filterscripts\rcon_cmds.pwn(40) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase 5 Errors. EDIT: Uite partea de sus a scriptului. [pawn]#include <a_samp> #include <zcmd> #include <sscanf> #define FILTERSCRIPT #if defined FILTERSCRIPT #define red 0xFF0000AA #define gray 0xAFAFAFAA #define orange 0xFF9900AA[/pawn]
  2. Am incerat, dar am esuat. [pawn]CMD:rcmds(playerid, params[]) { new rcmds[1150]; //-------------------------------------------------------------------------- if(IsPlayerAdmin(playerid)) { //---------------------------------------------------------------------- strcat(rcmds, "{FF0000}/SetKills {FF9900}» {AFAFAF} Seteaza Kills (Doar pentru tine)!\n\ {FF0000}/SetDeaths {FF9900}» {AFAFAF} Seteaza Deaths (Doar pentru tine)!\n\ {FF0000}/SetSpree {FF9900}» {AFAFAF} Seteaza Killing Spree(Doar pentru tine)!\n\ {FF0000}/SetBestKills {FF9900}» {AFAFAF} Seteaza Best Killing Spree(Doar pentru tine)!\n\ {FF0000}/SetHours {FF9900}» {AFAFAF} Setezi orele (Doar pentru tine)!"\n\ strcat(rcmds, "{FF0000}/SetRespect {FF9900}» {AFAFAF} Seteaza + la Respect!\n\ {FF0000}/SetMRespect {FF9900}» {AFAFAF} Seteaza - la Respect!\n\ {FF0000}/SetVWarn {FF9900}» {AFAFAF} Seteaza Warn la VIP\n"); strcat(rcmds, "{FF0000}/SetStunt {FF9900}» {AFAFAF} Seteaza Stunt Points\n\ {FF0000}/SetRace {FF9900}» {AFAFAF} seteaza Race Points.\n\ {FF0000}/SetDrift {FF9900}» {AFAFAF} Seteaza Drift Points.\n\ {FF0000}/Setc4 {FF9900}» {AFAFAF} Seteaza bombele c4.\n\ {FF0000}/SetLevel {FF9900}» {AFAFAF} Seteaza nivelul Admin-ului.\n\ {FF0000}/SetRVIP {FF9900}» {AFAFAF} Seteaza nivelul VIP-ului.\n\ {FF0000}/SetCoins {FF9900}» {AFAFAF} Seteaza Coins.\n\ {FF0000}/GiveallCoins {FF9900}» {AFAFAF} Setezi coins la toti playerii!\n\ \n"); ShowPlayerDialog(playerid, 123, DIALOG_STYLE_MSGBOX, "{0066CC}X{FFFF00}S{FF0000}D{AFAFAF} - RCON Commands", rcmds, "OK", ""); return 1; } else return SendClientMessage(playerid, red, "ERROR: Only RCON Admins can view this dialog!"); }[/pawn]
  3. Linia 30: [pawn]{FF0000}/SetRespect {FF9900}» {AFAFAF} Seteaza + la Respect!\n\[/pawn] Linia 31: [pawn]{FF0000}/SetMRespect {FF9900}» {AFAFAF} Seteaza - la Respect!\n\[/pawn]
  4. Deci, am un script, care arata un dialog cu comenzile pt. RCON. Doar Adminii RCON o pot folosi. Dar cand o compilez, nu-mi merge. [pawn]CMD:rcmds(playerid, params[]) { new rcmds[1150]; //-------------------------------------------------------------------------- if(IsPlayerAdmin(playerid)) { //---------------------------------------------------------------------- strcat(rcmds, "{FF0000}/SetKills {FF9900}» {AFAFAF} Seteaza Kills (Doar pentru tine)!\n\ {FF0000}/SetDeaths {FF9900}» {AFAFAF} Seteaza Deaths (Doar pentru tine)!\n\ {FF0000}/SetSpree {FF9900}» {AFAFAF} Seteaza Killing Spree(Doar pentru tine)!\n\ {FF0000}/SetBestKills {FF9900}» {AFAFAF} Seteaza Best Killing Spree(Doar pentru tine)!\n\ {FF0000}/SetHours {FF9900}» {AFAFAF} Setezi orele (Doar pentru tine)!\n\ {FF0000}/SetRespect {FF9900}» {AFAFAF} Seteaza + la Respect!\n\ {FF0000}/SetMRespect {FF9900}» {AFAFAF} Seteaza - la Respect!\n\ {FF0000}/SetVWarn {FF9900}» {AFAFAF} Seteaza Warn la VIP.\n\ \n"); strcat(rcmds, "{FF0000}/SetStunt {FF9900}» {AFAFAF} Seteaza Stunt Points\n\ {FF0000}/SetRace {FF9900}» {AFAFAF} seteaza Race Points.\n\ {FF0000}/SetDrift {FF9900}» {AFAFAF} Seteaza Drift Points.\n\ {FF0000}/Setc4 {FF9900}» {AFAFAF} Seteaza bombele c4.\n\ {FF0000}/SetLevel {FF9900}» {AFAFAF} Seteaza nivelul Admin-ului.\n\ {FF0000}/SetRVIP {FF9900}» {AFAFAF} Seteaza nivelul VIP-ului.\n\ {FF0000}/SetCoins {FF9900}» {AFAFAF} Seteaza Coins.\n\ {FF0000}/GiveallCoins {FF9900}» {AFAFAF} Setezi coins la toti playerii!\n\ \n"); ShowPlayerDialog(playerid, 123, DIALOG_STYLE_MSGBOX, "{0066CC}X{FFFF00}S{FF0000}D{AFAFAF} - RCON Commands", rcmds, "OK", ""); return 1; } else return SendClientMessage(playerid, red, "ERROR: Only RCON Admins can view this dialog!"); }[/pawn] Si erorile: C:\Users\- - -\Desktop\eXtreme Stunt Devil\filterscripts\rcon_cmds.pwn(30) : error 075: input line too long (after substitutions) C:\Users\- - -\Desktop\eXtreme Stunt Devil\filterscripts\rcon_cmds.pwn(31) : error 037: invalid string (possibly non-terminated string) C:\Users\- - -\Desktop\eXtreme Stunt Devil\filterscripts\rcon_cmds.pwn(31) : error 017: undefined symbol "FF0000" C:\Users\- - -\Desktop\eXtreme Stunt Devil\filterscripts\rcon_cmds.pwn(31) : warning 217: loose indentation C:\Users\- - -\Desktop\eXtreme Stunt Devil\filterscripts\rcon_cmds.pwn(31) : error 029: invalid expression, assumed zero C:\Users\- - -\Desktop\eXtreme Stunt Devil\filterscripts\rcon_cmds.pwn(31) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase 5 Errors.
  5. Deci, am observat in seara asta, cand ies de pe server, nu se salveaza deloc status-ul meu. Cand compilez LuxAdmin-ul, nu am nicio eroare/warning. Va rog, exista o rezolvare? :|
  6. C:\Users\- - -\Desktop\eXtreme Stunt Devil v5\gamemodes\xsd.pwn(4125) : error 035: argument type mismatch (argument 5) C:\Users\- - -\Desktop\eXtreme Stunt Devil v5\gamemodes\xsd.pwn(10180) : error 035: argument type mismatch (argument 5) C:\Users\- - -\Desktop\eXtreme Stunt Devil v5\gamemodes\xsd.pwn(13430) : error 037: invalid string (possibly non-terminated string) C:\Users\- - -\Desktop\eXtreme Stunt Devil v5\gamemodes\xsd.pwn(13430) : error 017: undefined symbol "AFAFAF" C:\Users\- - -\Desktop\eXtreme Stunt Devil v5\gamemodes\xsd.pwn(13430) : error 017: undefined symbol "Noutati" C:\Users\- - -\Desktop\eXtreme Stunt Devil v5\gamemodes\xsd.pwn(13430) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase 6 Errors.
  7. Salut. Deci nu stiu cum sa fac un nou rand in comanda news.. am facut, dar acum am 6 erori :| Uitati codul: [pawn]stock ShowNews() { new News[5024]; //-------------------------------------------------------------------------- strcat(News, "{AFAFAF}Noutati server\n\ \n\ {FF0000}» {AFAFAF}Au fost adaugate noi comenzi pentru RCON.\n strcat(News, "{FF0000}» {AFAFAF}La comanda {FF0000}/vheli {AFAFAF}pentru VIP Level 7, a fost adaugat un timer de 10 minute.\n\ {FF0000}» {AFAFAF}Culorile serverului, au fost schimbate in totalitate.\n\ {FF0000}» {AFAFAF}Au fost adaugate noi Radio-uri.\n\ {FF0000}» {AFAFAF}Un nou aspect la {FF0000}/stats{AFAFAF}.\n\ {FF0000}» {AFAFAF}S-a dat restart la {FF0000}Case, Coins, Ore, Clanuri, Kills{AFAFAF}.\n\ {FF0000}» {AFAFAF}Avem un nou Owner: {FF0000}ftw.\n"); strcat(News, "{FF0000}» {AFAFAF}La comanda {FF0000}/vtank{AFAFAF}, a fost adaugat un timer de 5 minute.\n\ {FF0000}» {AFAFAF}Am adaugat o noua mapa la {FF0000}/Chilliad{AFAFAF}!\n"); strcat(News, "{FF0000}Distractie Placuta!"); //-------------------------------------------------------------------------- return News; }[/pawn]
  8. 3xTaSY

    Ajutor :)

    Deci, vreau sa stiu cum pot face, ca atunci cand ai un anumit numar de Kills, sa-ti dea armour x% (x este doar un exemplu). De exemplu, daca am 100 Kills, cand intru pe server, dupa fiecare respawn, sa-mi scrie in chat: 20% Armour for you killer rank !
  9. WTF?! Chiar nu stii ca serverul asta este fostul tau server? Uita-te la sursa oficiala a topic-ului si dupa da-mi reply :]]
  10. Descriere : Salut . Am inceput sa lucrez la un proiect de stunt . Deoarece vreau sa imi hostez server-ul Va dau si voua v 1 . 0 [tt]Acesta este ultimul meu proiect . [/tt] Creatori : TheDucc xStormiest ( Register / Login [bUD] ) [funky]Anak1n ( Un bug minor ) Gireada ( Luck Event [Nu i-am cerut aprobare sa il folosesc ^^ .]) Poze : Click Here [screen] Click Here [screen] Click Here [screen] Click Here [screen] Click Here [screen] Click Here [screen] Click Here [screen] Click Here [screen] Click Here [screen] Click Here [screen] [download]http://pastebin.com/NLhsm7ja[/download] Bucurativa de el . Eu ma retrag . Bye :-h Topic oficial: aici.
  11. Done. Am reinstalat GTA San Andreas, si acum imi merge perfect. Thx. T/C
  12. Mi-am instalat SAMI si cred ca de la el este problema.. L-am dezinstalat deja, dar vad ca tot nu isi revine SA:MP-ul xd EDIT: Am uitat sa precizez, ca nu folosesc niciun mod pe Grand Theft Auto: San Andreas!
  13. Salut Deci, cand am incercat sa intru pe SA:MP, am deschis un server, si mi-a aparut un crash cu urmatorul motiv: SA-MP 0.3x-R1-2 Exception At Address: 0x004DD5A3 Base: 0x03B90000 Registers: EAX: 0x00000032 EBX: 0x00000000 ECX: 0x00000000 EDX: 0x0008E8B8 ESI: 0x00B6BD44 EDI: 0x00000001 EBP: 0x76106C30 ESP: 0x0028FCCC EFLAGS: 0x00210293 Stack: +0000: 0x00000001 0x0000000A 0x76106C30 0x00000000 +0010: 0x0028FCEC 0xBF800000 0x00000000 0x00000000 +0020: 0x3F800000 0x00000000 0x00000000 0x00000000 +0030: 0x3F800000 0x00000000 0x02244F00 0x00000024 +0040: 0x00000000 0x00000000 0x00000000 0x00000070 +0050: 0xFFFFFFFF 0xFFFFFFFF 0x760F6CE9 0x760F6D91 +0060: 0x775A010A 0x00000001 0x00000000 0x00000000 +0070: 0x0028FCF8 0x02244F00 0x0028FDA4 0x7615A61E +0080: 0x6454EE51 0xFFFFFFFE 0x760F6D51 0x760F77C4 +0090: 0x00000000 0x76100735 0x761006EB 0x0028FE1C +00A0: 0x00000000 0x00000000 0x00000000 0x00000003 +00B0: 0x0225C080 0xBDCCCCCD 0x3F800000 0x00000000 +00C0: 0x3DCCCCCD 0x3F800000 0x00000000 0x3DCCCCCD +00D0: 0xBF800000 0x00000000 0xBDCCCCCD 0xBF800000 +00E0: 0x00000000 0x0028FF78 0x0083BF3B 0xFFFFFFFF +00F0: 0x00507424 0x00000032 0x00000000 0x3F800000 +0100: 0x00748CFB 0x76BC1245 0x00000000 0x0028FF88 +0110: 0x7EFDE000 0x01690000 0x00000008 0x016910F0 +0120: 0x00000008 0x00000100 0x00000008 0x00000102 +0130: 0x43C80000 0x43960000 0x00000000 0x00000000 +0140: 0x00000320 0x00000258 0x00000000 0x0028FE54 +0150: 0x000D02BE 0x00000200 0x00000000 0x008D0191 +0160: 0x00DCC5C2 0x00000191 0x0000008D 0x0000002C +0170: 0x0028FE2C 0x00825EA4 0x76BC1245 0x00000000 +0180: 0x7EFDE000 0xFFFFFFFF 0x00821D17 0x00000065 +0190: 0x00000065 0x0028FF88 0x008246F1 0x00400000 +01A0: 0x00000000 0x01BA2A61 0x0000000A 0x00000094 +01B0: 0x00000006 0x00000001 0x00001DB1 0x00000002 +01C0: 0x76726553 0x20656369 0x6B636150 0x00003120 +01D0: 0x00000000 0x00000000 0x00000000 0x00000000 +01E0: 0x00000000 0x00000000 0x00000000 0x00000000 +01F0: 0x00000000 0x00000000 0x00000000 0x00000000 +0200: 0x00000000 0x00000000 0x00000000 0x00000000 +0210: 0x00000000 0x00000000 0x00000000 0x00000000 +0220: 0x00000000 0x00000000 0x00000000 0x00000000 +0230: 0x00000000 0x00000000 0x00000000 0x00824588 +0240: 0x00000000 0x00000000 0x7EFDE000 0xC0000005 +0250: 0x00000000 0x01BA2A61 0x00000044 0x01BD38F8 +0260: 0x01BD61D8 0x01BD72C8 0x00000000 0x00000000 +0270: 0x00000000 0x00000000 0x00000000 0x00000000 SCM Op: 0x0, lDbg: 0 LastRendObj: 0 Game Version: US 1.0 Stiti cumva ce este de facut ?
  14. 3xTaSY

    Problema

    Multumesc. Am rezolvat. Puteti inchide topic-ul.
  15. 3xTaSY

    Problema

    Multumesc. Acum imi da 8 erori: C:\Users\Bogdan\Desktop\Server\pawno\include\dutils.inc(200) : error 025: function heading differs from prototype C:\Users\Bogdan\Desktop\Server\pawno\include\dutils.inc(200) : error 021: symbol already defined: "SetPlayerMoney" C:\Users\Bogdan\Desktop\Server\pawno\include\dutils.inc(201) : error 017: undefined symbol "ResetPlayerMoney" C:\Users\Bogdan\Desktop\Server\pawno\include\dutils.inc(202) : error 017: undefined symbol "GivePlayerMoney" C:\Users\Bogdan\Desktop\Server\pawno\include\dutils.inc(203) : error 017: undefined symbol "PData" C:\Users\Bogdan\Desktop\Server\pawno\include\dutils.inc(203) : warning 215: expression has no effect C:\Users\Bogdan\Desktop\Server\pawno\include\dutils.inc(203) : error 001: expected token: ";", but found "]" C:\Users\Bogdan\Desktop\Server\pawno\include\dutils.inc(203) : error 029: invalid expression, assumed zero C:\Users\Bogdan\Desktop\Server\pawno\include\dutils.inc(203) : fatal error 107: too many error messages on one line
  16. 3xTaSY

    Problema

    Salut ^^ Deci, cand am incercat sa compilez un gamemode, mi-a scris urmatorile erori: C:\Users\Bogdan\Desktop\Server\pawno\include\dutils.inc(196) : error 025: function heading differs from prototype C:\Users\Bogdan\Desktop\Server\pawno\include\dutils.inc(196) : error 021: symbol already defined: "JB_SetPlayerMoney" C:\Users\Bogdan\Desktop\Server\pawno\include\dutils.inc(200) : error 017: undefined symbol "SetPlayerMoney" Stiti voi cum pot rezolva aceasta problema? EDIT: Am uitat sa pun si continutul fisierului dutils.inc: [pawn]/* * DUtils functions 1.8 * © Copyright 2006-2007 by DracoBlue * * @author : DracoBlue (http://dracoblue.com) * @date : 8th April 2006 * @update : 3rd June. 2007 * * This file is provided as is (no warranties). * */ #if defined _dutils_included #endinput #endif #define _dutils_included #pragma library dutils #define MAX_STRING 255 #if !defined floatstr native Float:floatstr(const string[]); #endif #pragma tabsize 0 new PRIVATE_Last_Money[MAX_PLAYERS]; /* * First version released by mike, this one created by DracoBlue * Has also a fix to use "-" and "+" in the beginning of the number. */ stock isNumeric(const string[]) { new length=strlen(string); if (length==0) return false; for (new i = 0; i < length; i++) { if ( (string > '9' || string < '0' && string!='-' && string!='+') // Not a number,'+' or '-' || (string=='-' && i!=0) // A '-' but not at first. || (string=='+' && i!=0) // A '+' but not at first. ) return false; } if (length==1 && (string[0]=='-' || string[0]=='+')) return false; return true; } #pragma unused isNumeric /* * Originally created by mabako, tuned by DracoBlue */ stock mktime(hour,minute,second,day,month,year) { new timestamp2; timestamp2 = second + (minute * 60) + (hour * 3600); new days_of_month[12]; if ( ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0) ) { days_of_month = {31,29,31,30,31,30,31,31,30,31,30,31}; // Schaltjahr } else { days_of_month = {31,28,31,30,31,30,31,31,30,31,30,31}; // keins } new days_this_year = 0; days_this_year = day; if(month > 1) { // No January Calculation, because its always the 0 past months for(new i=0; i<month-1;i++) { days_this_year += days_of_month; } } timestamp2 += days_this_year * 86400; for(new j=1970;j<year;j++) { timestamp2 += 31536000; if ( ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0) ) timestamp2 += 86400; // Schaltjahr + 1 Tag } return timestamp2; } #pragma unused mktime /** * Return if a Email is valid or not * @param value */ stock ValidEmail(email[]) { new len=strlen(email); new cstate=0; new i; for(i=0;i<len;i++) { if ((cstate==0 || cstate==1) && (email>='A' && email<='Z') || (email>='a' && email<='z') || (email=='.') || (email=='-') || (email=='_')) { } else { // Ok no A..Z,a..z,_,.,- if ((cstate==0) &&(email=='@')) { // its an @ after the name, ok state=1; cstate=1; } else { // Its stuff which is not allowed return false; } } } if (cstate<1) return false; if (len<6) return false; // A toplevel domain has only 3 to 4 signs :-) if ((email[len-3]=='.') || (email[len-4]=='.') || (email[len-5]=='.')) return true; return false; } #pragma unused ValidEmail /** * Return a timestamp */ stock Time() { new hour,minute,second; new year, month,day; gettime(hour, minute, second); getdate(year, month, day); return mktime(hour,minute,second,day,month,year); } #pragma unused Time /** * Return a timestamp */ Now() { new hour,minute,second; new year, month,day; gettime(hour, minute, second); getdate(year, month, day); return mktime(hour,minute,second,day,month,year); } #pragma unused Now /** * Return the value of an hex-string * @param string */ HexToInt(string[]) { if (string[0]==0) return 0; new i; new cur=1; new res=0; for (i=strlen(string);i>0;i--) { if (string[i-1]<58) res=res+cur*(string[i-1]-48); else res=res+cur*(string[i-1]-65+10); cur=cur*16; } return res; } #pragma unused HexToInt /** * Return the string as int * @param string */ StrToInt(string[]) { return strval(string); } #pragma unused StrToInt /** * Return the value as string * @param value */ IntToStr(value) { new tmp[MAX_STRING]; valstr(tmp, num); return tmp; } #pragma unused IntToStr /** * Return the truncated value * @param Float:value */ trunc(Float:value) { return floatround(value,floatround_floor); } #pragma unused trunc /** * Sets money for player * @param playerid * howmuch */ SetPlayerMoney(playerid,howmuch) { PRIVATE_Last_Money[playerid]=howmuch; GivePlayerMoney(playerid,howmuch-GetPlayerMoney(playerid)); } #pragma unused SetPlayerMoney /** * Copies a file (Source file won't be deleted!) * @param oldname * newname * @requires WINDOWS */ fcopy(oldname[],newname[]) { new File:ohnd,File:nhnd; if (!fexist(oldname)) return false; ohnd=fopen(oldname,io_read); nhnd=fopen(newname,io_write); new buf2[1]; new i; for (i=flength(ohnd);i>0;i--) { fputchar(nhnd, fgetchar(ohnd, buf2[0],false),false); } fclose(ohnd); fclose(nhnd); return true; } #pragma unused fcopy /** * Copies a textfile (Source file won't be deleted!) * @param oldname * newname */ fcopytextfile(oldname[],newname[]) { new File:ohnd,File:nhnd; if (!fexist(oldname)) return false; ohnd=fopen(oldname,io_read); nhnd=fopen(newname,io_write); new tmpres[MAX_STRING]; while (fread(ohnd,tmpres)) { StripNewLine(tmpres); format(tmpres,sizeof(tmpres),"%s\r\n",tmpres); fwrite(nhnd,tmpres); } fclose(ohnd); fclose(nhnd); return true; } #pragma unused fcopytextfile /** * Renames a file (Source file will be deleted!) * @param oldname * newname * @requires WINDOWS (because fcopy does) */ frename(oldname[],newname[]) { if (!fexist(oldname)) return false; fremove(newname); if (!fcopy(oldname,newname)) return false; fremove(oldname); return true; } #pragma unused frename /** * Strips Newline from the end of a string. * Idea: Y_Less, Bugfixing (when length=1) by DracoBlue * @param string */ stock StripNewLine(string[]) { new len = strlen(string); if (string[0]==0) return ; if ((string[len - 1] == '\n') || (string[len - 1] == '\r')) { string[len - 1] = 0; if (string[0]==0) return ; if ((string[len - 2] == '\n') || (string[len - 2] == '\r')) string[len - 2] = 0; } } #pragma unused StripNewLine /** * Copies items from one array/string into return. * @param source * index (where to start, 0 is first) * numbytes (how much) */ ret_memcpy(source[],index=0,numbytes) { new tmp[MAX_STRING]; new i=0; tmp[0]=0; if (index>=strlen(source)) return tmp; if (numbytes+index>=strlen(source)) numbytes=strlen(source)-index; if (numbytes<=0) return tmp; for (i=index;i<numbytes+index;i++) { tmp[i-index]=source; if (source==0) return tmp; } tmp[numbytes]=0; return tmp; } #pragma unused ret_memcpy /** * Copies items from one array/string into another. * @param dest * source * count */ stock copy(dest[],source[],count) { dest[0]=0; if (count<0) return false; if (count>strlen(source)) count=strlen(source); new i=0; for (i=0;i<count;i++) { dest=source; if (source==0) return true; } dest[count]=0; return true; } #pragma unused copy /** * Deletes the first 'count' items of a array/string * @param string[] * count */ stock delete(string[],count) { new tmp[MAX_STRING]; tmp[0]=0; if (count<=0) { format(tmp,sizeof(tmp),"%s",string); return tmp; } tmp=ret_memcpy(string,count,strlen(string)); return tmp; } #pragma unused delete /** * Sets a string's value to source. * @param dest * source * count */ stock set(dest[],source[]) { new count = strlen(source); new i=0; for (i=0;i<count;i++) { dest=source; } dest[count]=0; } #pragma unused set /** * Checks wether two strings are equal (case insensetive) * @param str1 * str2 */ stock equal(str1[],str2[],bool:ignorecase) { if (strlen(str1)!=strlen(str2)) return false; if (strcmp(str1,str2,ignorecase)==0) return true; return false; } #pragma unused equal /** * Returns an element of a string splitted by ' ', default index is 0. * @param string * index */ strtok(const string[], &index,seperator=' ') { new length = strlen(string); new offset = index; new result[MAX_STRING]; while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; if ((index < length) && (string[index] == seperator)) { index++; } return result; } #pragma unused strtok stock mod(up,down) { return up-(floatround((up/down),floatround_floor))*down; } #pragma unused mod stock div(up,down) { return (floatround((up/down),floatround_floor)); } #pragma unused div /** * Returns a hashed value in adler32 as int * @param buf */ stock num_hash(buf[]) { new length=strlen(buf); new s1 = 1; new s2 = 0; new n; for (n=0; n<length; n++) { s1 = (s1 + buf[n]) % 65521; s2 = (s2 + s1) % 65521; } return (s2 << 16) + s1; } #pragma unused num_hash /** * Returns a hashed value in adler32 as string * @param buf */ stock hash(str2[]) { new tmpdasdsa[MAX_STRING]; tmpdasdsa[0]=0; valstr(tmpdasdsa,num_hash(str2)); return tmpdasdsa; } #pragma unused hash /** * Returns a string which has 'newstr' where 'trg' was before * @param trg * newstr * src */ strreplace(trg[],newstr[],src[]) { new f=0; new s1[MAX_STRING]; new tmp[MAX_STRING]; format(s1,sizeof(s1),"%s",src); f = strfind(s1,trg); tmp[0]=0; while (f>=0) { strcat(tmp,ret_memcpy(s1, 0, f)); strcat(tmp,newstr); format(s1,sizeof(s1),"%s",ret_memcpy(s1, f+strlen(trg), strlen(s1)-f)); f = strfind(s1,trg); } strcat(tmp,s1); return tmp; } #pragma unused strreplace /** * Returns the string with lowercase * @param txt */ strlower(txt[]) { new tmp[MAX_STRING]; tmp[0]=0; if (txt[0]==0) return tmp; new i=0; for (i=0;i<strlen(txt);i++) { tmp=tolower(txt); } tmp[strlen(txt)]=0; return tmp; } #pragma unused strlower /** * Returns the string with uppercase * @param txt */ strupper(txt[]) { new tmp[MAX_STRING]; tmp[0]=0; if (txt[0]==0) return tmp; new i=0; [/pawn]
  17. Misto systemul de createclan.. GG 5/5
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.