-
Posts
490 -
Joined
-
Last visited
-
Days Won
3
Content Type
Profiles
Forums
News
Documentation
Posts posted by TheGodfather
-
-
11 minutes ago, Banditul said:
## `error 017: undefined symbol "_is_now_DYNAMIC_MEMORY_"` This will occur on: #pragma dynamic 65536 The error tries to explain the problem. y_malloc can allocate memory from the heap or from global memory. If you are not using `YSI_NO_HEAP_MALLOC` it will use the heap (obviously), aka. dynamic memory. Because of this, it needs to control how much dynamic memory there is. Thus, instead of using `#pragma dynamic`, use `DYNAMIC_MEMORY`: #define DYNAMIC_MEMORY (65536) // Inainte de orice include
public e_COMMAND_ERRORS:OnPlayerCommandReceived(playerid, cmdtext[], e_COMMAND_ERRORS:success) public e_COMMAND_ERRORS:OnPlayerCommandPerformed(playerid, cmdtext[], e_COMMAND_ERRORS:success)
Si aici gasesti ce valori sa verifici pentru if (success == ) https://github.com/Misiur/YSI-Includes/blob/e9cf7a1e4154517f2b06cbd36efd0742c2cc3408/YSI_Visual/y_commands/impl.inc#L108-L120
Cat despre acel timer nu sunt 100% sigur pentru ca e prima data folosit in felul asta
https://github.com/pawn-lang/YSI-Includes/blob/5.x/YSI_Coding/y_timers/features.md
Presupun ca poti pune Timer:timer Pacanele[]()
Pentru if(success == ...)
(39277) : warning 213: tag mismatch: expected tag "e_COMMAND_ERRORS", but found none ("_")
-
50 minutes ago, Banditul said:
Aparent exista o functie in YSI numita Range
stock Range(const arr[], num = sizeof (arr))
Va trebui sa iti modifici numele parametului , poate in loc de Range sa fie range
Edit: Eroarea de la linia 278 e probabil "Dont use SCM" care inseamna ca va trebui sa scrii SendClientMessage
Din sutele de erori/warninguri am reusit sa ajung doar la cateva:
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Visual\y_commands\y_commands_impl.inc(197) : error 025: function heading differs from prototype
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Visual\y_commands\y_commands_impl.inc(198) : error 025: function heading differs from prototype
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Coding\y_timers\..\y_malloc\y_malloc_warning.inc(7) : warning 237: user warning: y_malloc heap allocation is unstable. Use `YSI_NO_HEAP_MALLOC` to disable it, or `YSI_YES_HEAP_MALLOC` to disable this warning: git.io/YSI_HEAP_MALLOC
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(3294) : warning 213: tag mismatch: expected tag "Timer", but found none ("_")
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(39197) : error 025: function heading differs from prototype
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(39270) : error 025: function heading differs from prototype
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(46781) : error 017: undefined symbol "_is_now_DYNAMIC_MEMORY_" -
M-a rupt...
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Data\y_foreach\..\..\YSI_Core\y_core\y_utils_impl.inc(236) : warning 219: local variable "ip" shadows a variable at a preceding level
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Data\y_foreach\..\..\YSI_Core\y_core\y_utils_impl.inc(901) : warning 219: local variable "ip" shadows a variable at a preceding level
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Data\y_foreach\..\..\YSI_Coding\y_va\..\..\YSI_Core\y_core\..\..\amx\disasm.inc(111) : warning 219: local variable "ip" shadows a variable at a preceding level
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Data\y_foreach\..\..\YSI_Coding\y_va\..\..\YSI_Core\y_core\..\..\amx\disasm.inc(144) : warning 219: local variable "ip" shadows a variable at a preceding level
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Data\y_foreach\..\..\YSI_Coding\y_hooks\y_hooks_impl.inc(659) : warning 219: local variable "sName" shadows a variable at a preceding level
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Data\y_foreach\y_foreach_iterators.inc(117) : error 017: undefined symbol "MAX_ACTORS"
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Data\y_foreach\y_foreach_iterators.inc(120) : error 017: undefined symbol "MAX_ACTORS"
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Data\y_foreach\y_foreach_iterators.inc(122) : error 017: undefined symbol "MAX_ACTORS"
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Data\y_foreach\y_foreach_iterators.inc(395) : error 017: undefined symbol "MAX_ACTORS"
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Visual\y_commands\y_commands_impl.inc(197) : error 025: function heading differs from prototype
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Visual\y_commands\y_commands_impl.inc(198) : error 025: function heading differs from prototype
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Coding\y_timers\..\y_malloc\y_malloc_warning.inc(7) : warning 237: user warning: y_malloc heap allocation is unstable. Use `YSI_NO_HEAP_MALLOC` to disable it, or `YSI_YES_HEAP_MALLOC` to disable this warning: git.io/YSI_HEAP_MALLOC
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\dropAir.inc(64) : error 021: symbol already defined: "@yH_OnPlayerConnect@004"
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\dropAir.inc(64) : warning 209: function "@yH_OnPlayerConnect@004" should return a value
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\dropAir.inc(65) : error 021: symbol already defined: "@yH_OnPlayerDisconnect@004"
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\dropAir.inc(120) : warning 219: local variable "using_deprecated_foreach_syntax" shadows a variable at a preceding level
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\dropAir.inc(185) : error 017: undefined symbol "DONT_USE"
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(180) : error 021: symbol already defined: "Range"
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(190) : warning 219: local variable "using_deprecated_foreach_syntax" shadows a variable at a preceding level
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(201) : warning 219: local variable "using_deprecated_foreach_syntax" shadows a variable at a preceding level
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(232) : warning 219: local variable "using_deprecated_foreach_syntax" shadows a variable at a preceding level
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(278) : error 017: undefined symbol "DONT_USE"
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(353) : error 076: syntax error in the expression, or invalid function call
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(358) : error 076: syntax error in the expression, or invalid function call
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(358) : error 076: syntax error in the expression, or invalid function call
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(362) : error 076: syntax error in the expression, or invalid function call
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(367) : error 076: syntax error in the expression, or invalid function call
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(367) : error 076: syntax error in the expression, or invalid function call
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(372) : error 076: syntax error in the expression, or invalid function call
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(377) : error 076: syntax error in the expression, or invalid function call
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(377) : error 076: syntax error in the expression, or invalid function call
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(381) : error 076: syntax error in the expression, or invalid function call
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(386) : error 076: syntax error in the expression, or invalid function call
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(386) : error 076: syntax error in the expression, or invalid function call
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(397) : error 076: syntax error in the expression, or invalid function call
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(397) : warning 215: expression has no effect
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(402) : error 076: syntax error in the expression, or invalid function call
C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(402) : error 076: syntax error in the expression, or invalid function call -
-
4 minutes ago, Banditul said:
Esti sigur ca ai pus folderele/fisierele de la YSI in folderul pawno > include ?
Da, acum primesc eroarea asta: fatal error 100: cannot read from file: "YSI\y_hooks". Am incercat sa pun fisierul y_hooks in fisierul YSI dar primesc aceeasi eroare
-
1 minute ago, Banditul said:
Nu folosi #include <foreach> foloseste #include <YSI_Data\y_iterate>
Imi spune asta: fatal error 100: cannot read from file: "YSI_Data\y_iterate"
-
Aceeasi eroare, cea cu natives
-
3 minutes ago, Krootch said:
Si ultima versiune de Zeex?
Da
-
Just now, Krootch said:
Incearca ultima versiune de YSI, daca folosesti Zeex compiler, foloseste ultima versiune si daca primesti warning uri, imi dai mesaj in privat si le rezolv.
Am dat putin mai sus un reply catre Banditul legat de eroarea pe care o primesc dupa ce am pus ultima versiune de YSI. Folosesc Zeex compiler.
-
53 minutes ago, Banditul said:
Dupa ce am pus ce este acolo in includes, primesc mesajul acesta: ...\pawno\include\foreach.inc(230) : fatal error 100: cannot read from file: "YSI\internal\y_natives"
-
1 hour ago, Banditul said:
Nu e nici o diferenta. Dar daca folosesti prima sintaxa si nu primesti warning legat de faptul ca sintaxa e veche atunci inseamna ca folosesti o versiune foarte antica de YSI sau folosesti acel foreach standalone care e la fel de antic si care recomandat nu ar trebui folosite.
Noile versiuni de YSI au destul de multe imbunatatiri atat de performanta cat si noi functionalitati.
Inteleg, multumesc frumos pentru explicatie
Edit: Oare ai putea sa imi dai un link de unde as putea sa iau ultima versiune? Multumesc
-
Salut, am vazut pe internet 2 moduri pentru a scrie un foreach si sunt curios ce diferente sunt (daca sunt) intre foreach(Player, i) si foreach(new i : Player) inafara de modul de scriere, desigur.
-
1 hour ago, iSorin[] said:
si daca iei spawn dupa /sspecoff si nu te spawnezi in casa atunci valoarea tot -1 o sa fie.
Nu iau spawn
-
1 hour ago, iSorin[] said:
Daca vei iesi din casa atunci valorea va fi -1 daca nu iesi vezi sa nu fie ceva timer pentru actualizarea sa
Nu este niciun timer. E ceva problema la una din comenzile /sspec sau /sspecoff
-
1 minute ago, iSorin[] said:
de ce InHouse[playerid] trebuie sa fie neaprat 107?
Nu e neaparat sa fie 107, asta e valoarea pe care trebuie sa o puna pentru casa in care testez. De asta am pus 107 dar tot -1 pune
-
Am incercat si asa iar cand dau /test imi spune ca la InHouse e -1...
SetPlayerPos(playerid, InainteDeSpec[playerid][0], InainteDeSpec[playerid][1], InainteDeSpec[playerid][2]);
InHouse[playerid] = 107;//inaintehouse[playerid];
InHQ[playerid] = inaintehq[playerid];
InBussines[playerid] = inaintebusiness[playerid];
SCMf(playerid, -1, "house: %d l hq: %d l Biz: %d", InHouse[playerid], InHQ[playerid], InBussines[playerid]);return true;
-
2 minutes ago, iSorin[] said:
de unde stii tu ca valorea este -1? ai ceva comanda prin care iti arata? daca da arato
YCMD:test(playerid, params[], help) {
SCMf(playerid, -1, "pInt: %d l pLocal: %d l InHouse: %d l InHQ: %d l InBussines: %d", PlayerInfo[playerid][pInt], PlayerInfo[playerid][pLocal], InHouse[playerid], InHQ[playerid], InBussines[playerid]);
return 1;
} -
Salut, cand dau /sspecoff la inhouse in loc sa imi puna valoarea 107 imi pune valoarea -1 chiar daca la ultimul mesaj de la /sspecoff la in house imi spune 107. Aveti idee de ce?
YCMD:sspec(playerid, params[], help) {
if(aspam[playerid] > 0) return SCMf(playerid, COLOR_LIGHTRED, "[Command Anti-Spam] {FFFFFF}Wait %d %s.", aspam[playerid], aspam[playerid] > 1 ? "seconds" : "second");
if(PlayerInfo[playerid][pAdmin] < return SCM(playerid, COLOR_WHITE, AdminOnly);
virtualw = GetPlayerVirtualWorld(playerid);
new id,string[180];
if(sscanf(params, "u", id)) return SCM(playerid,COLOR_GREY, "Syntax: {FFFFFF}/spec <playerid/name>");
if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SCM(playerid, COLOR_GREY, "That player is not connected.");
if(id == playerid) return SCM(playerid, COLOR_GREY, "You can not use this command on you!");
if(PlayerInfo[id][pAdmin] > PlayerInfo[playerid][pAdmin]) return SCM(playerid, COLOR_GREY, "You can not use this command on that player.");
if(IsPlayerLogged[id] == 0) return SCM(playerid, COLOR_LGREEN, "Error: That player is logging!");
Spectate[playerid] = id;
SpecPlayers[playerid] ++;
if(SpecPlayers[playerid] == 1) {
GetPlayerPos(playerid, SpecPos[playerid][0], SpecPos[playerid][1], SpecPos[playerid][2]);
IsPlayerSpec[playerid] = 1;
pInteriorID[playerid] = GetPlayerInterior(playerid);
pVirtual[playerid] = GetPlayerVirtualWorld(playerid);
//inaintespec
GetPlayerPos(playerid, InainteDeSpec[playerid][0], InainteDeSpec[playerid][1], InainteDeSpec[playerid][2]);
inaintehouse[playerid] = InHouse[playerid];
inaintehq[playerid] = InHQ[playerid];
inaintebusiness[playerid] = InBussines[playerid];
//inaintespec
}
new Float:health;
GetPlayerHealthEx(Spectate[playerid], health);
new rank[50];
if(PlayerInfo[playerid][pAdmin] != 0) rank = "Admin";
else rank = "Helper";
if(GetPVarInt(id, "Reported") == 1 && GetPVarInt(id, "ReportType") != 4 && PlayerInfo[playerid][pAdmin] >= 1) {
SetPVarInt(id, "Reported", 0);
SetPVarInt(id, "ReportType", 0);
SetPVarString(id, "ReportedBy", "");
SetPVarInt(id, "ReportScore", 0);
SetPVarString(id, "ReportText", "");
}
if(PlayerInfo[playerid][pAdmin] >= 1 && GetPVarInt(id, "ReportType") != 4) {
PlayerInfo[playerid][pHelpedPlayers] += GetPVarInt(id, "ReportScore");
PlayerInfo[playerid][pHelpedPlayersToday] += GetPVarInt(id, "ReportScore");
}
new szQuery[256];
mysql_format(SQL, szQuery, sizeof(szQuery), "UPDATE users SET `HelpedPlayers` = '%d', `HelpedPlayersToday`='%d' WHERE `ID` = '%d'", PlayerInfo[playerid][pHelpedPlayers], PlayerInfo[playerid][pHelpedPlayersToday], PlayerInfo[playerid][pSQLID]);
mysql_tquery(SQL, szQuery, "", "");
format(string, sizeof(string), "[SPEC] (%d) %s | Level: %d | Health: %.2f | AFK Time: %d | Seconds: %.0f | Duty: %d | Ping: %d",id,GetName(id),PlayerInfo[id][pLevel], health, AFKSeconds[id], PlayerInfo[id][pSeconds], OnDuty[id], GetPlayerPing(id));
SCM(playerid, 0xFFADADFF, string);
new Player_Weapons[13], Player_Ammos[13], i, guns;
string = "Weapons:";
for(i = 1;i <= 12;i++) {
GetPlayerWeaponData(id,i,Player_Weapons[i],Player_Ammos[i]);
if(Player_Weapons[i] != 0) {
new weaponName[180];
GetWeaponName(Player_Weapons[i],weaponName,255);
format(string,255, "%s %s (%d)", string, weaponName,Player_Ammos[i]);
guns ++;
}
}
if(guns > 0) SCM(playerid, -1, string);
Iter_Add(MySpec[id], playerid);TogglePlayerSpectating(playerid, 1);
SetPlayerInterior(playerid, GetPlayerInterior(id));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
if(IsPlayerInAnyVehicle(Spectate[playerid])) PlayerSpectateVehicle(playerid, GetPlayerVehicleID(Spectate[playerid]));
else PlayerSpectatePlayer(playerid, Spectate[playerid]);
PlayerTextDrawSetString(playerid, SpectatorTD, "Loading...");
PlayerTextDrawShow(playerid, SpectatorTD);
return true;
}YCMD:sspecoff(playerid, params[], help) {
if(aspam[playerid] > 0) return SCMf(playerid, COLOR_LIGHTRED, "[Command Anti-Spam] {FFFFFF}Wait %d %s.", aspam[playerid], aspam[playerid] > 1 ? "seconds" : "second");
if(PlayerInfo[playerid][pAdmin] < return SCM(playerid, COLOR_WHITE, AdminOnly);
if(Spectate[playerid] == 255) return SCM(playerid, COLOR_GREY, "You are not spectating a player.");
TogglePlayerControllable(playerid, 1);
TogglePlayerSpectating(playerid, 0);
PlayerInfo[playerid][pInt] = pInteriorID[playerid];
PlayerInfo[playerid][pLocal] = pVirtual[playerid];
SetPlayerInterior(playerid, pInteriorID[playerid]);
Unspec[playerid][sLocal] = 255;
gTeam[playerid] = PlayerInfo[playerid][pTeam];
SetPlayerToTeamColor(playerid);
SCM(playerid, -1, "You are no longer spectating!");
Iter_Remove(MySpec[Spectate[playerid]], playerid);
Spectate[playerid] = 255;
SpecPlayers[playerid] = 0;
LastRecon[playerid] = 1;
PlayerTextDrawHide(playerid, SpectatorTD);
Iter_Clear(MySpec[playerid]);
//inaintespec
SetPlayerPos(playerid, InainteDeSpec[playerid][0], InainteDeSpec[playerid][1], InainteDeSpec[playerid][2]);
InHouse[playerid] = inaintehouse[playerid];
InHQ[playerid] = inaintehq[playerid];
InBussines[playerid] = inaintebusiness[playerid];
SCMf(playerid, -1, "house: %d l hq: %d l Biz: %d", InHouse[playerid], InHQ[playerid], InBussines[playerid]);
//inaintespec
return true;
} -
Am rezolvat
-
Salut, am gasit acest bug pe gm b-hood editat de hpq123, aveti idee cum pot rezolva?
Descriere:
-
30 minutes ago, iSorin[] said:
Poate sa puna si case 100 ca nu are treaba. Apropo 1 + 10 cat face domnule?
Cat despre erori zice ca case-ul 187 exista deja, deci cel mai probabil nu e de acolo.Nu mai spune daca nu stii, random(10) merge de la 0 la 9. Nu ti-a iesit tentativa de baza pup
-
12 hours ago, Mihai FTW said:
salut am adaugat si eu un sistem de trylucky pe un gm bigzone edit de alexrap
si am erorile astea:
gm.pwn(23396) : error 040: duplicate "case" label (value 187)
gm.pwn(23404) : warning 202: number of arguments does not match definition
gm.pwn(23408) : warning 202: number of arguments does not match definition
gm.pwn(23412) : warning 202: number of arguments does not match definition
gm.pwn(23416) : warning 202: number of arguments does not match definition
gm.pwn(23420) : warning 202: number of arguments does not match definition
gm.pwn(23424) : warning 202: number of arguments does not match definition
gm.pwn(23429) : warning 202: number of arguments does not match definition
gm.pwn(23435) : warning 202: number of arguments does not match definition
gm.pwn(23439) : warning 202: number of arguments does not match definition
gm.pwn(23443) : warning 202: number of arguments does not match definition
gm.pwn(23447) : warning 202: number of arguments does not match definition
codu;
case DIALOG_TRYLUCKY: {
if(!response) return 1;
if(GetPlayerCash(playerid) <= strval(inputtext)) return SCM(playerid, COLOR_GREY, "Nu ai aceasta suma la tine!");
if(strval(inputtext) < 10000000) return SCM(playerid, COLOR_GREY, "Suma minima este de $10.000.000");
new castig = 1 + random(10);
switch(castig) {
case 1: {
GivePlayerCash(playerid, -strval(inputtext));
SCM(playerid, COLOR_RED, "Azi nu ai avut noroc si ai {FFFFFF}pierdut{CC0000} $%s!", FormatNumber(strval(inputtext)));
}
case 2: {
GivePlayerCash(playerid, -strval(inputtext));
SCM(playerid, COLOR_RED, "Azi nu ai avut noroc si ai {FFFFFF}pierdut{CC0000} $%s!", FormatNumber(strval(inputtext)));
}
case 3: {
GivePlayerCash(playerid, -strval(inputtext));
SCM(playerid, COLOR_RED, "Azi nu ai avut noroc si ai {FFFFFF}pierdut{CC0000} $%s!", FormatNumber(strval(inputtext)));
}
case 4: {
GivePlayerCash(playerid, -strval(inputtext));
SCM(playerid, COLOR_RED, "Azi nu ai avut noroc si ai {FFFFFF}pierdut{CC0000} $%s!", FormatNumber(strval(inputtext)));
}
case 5: {
GivePlayerCash(playerid, -strval(inputtext));
SCM(playerid, COLOR_RED, "Azi nu ai avut noroc si ai {FFFFFF}pierdut{CC0000} $%s!", FormatNumber(strval(inputtext)));
}
case 6: {
GivePlayerCash(playerid, -strval(inputtext));
SCM(playerid, COLOR_RED, "Azi nu ai avut noroc si ai {FFFFFF}pierdut{CC0000} $%s!", FormatNumber(strval(inputtext)));
}
case 7: {
new stringsds[128];
GivePlayerCash(playerid, strval(inputtext)*2);
SCM(playerid, COLOR_RED, "Azi ai avut noroc si ai {FFFFFF}castigat{CC0000} $%s!", FormatNumber(strval(inputtext)*2));
format(stringsds, sizeof(stringsds), "%s a avut noroc si a {FFFFFF}castigat{CC0000} $%s!", GetName(playerid), FormatNumber(strval(inputtext)*2));
SendClientMessageToAll(COLOR_RED, stringsds);
}
case 8: {
GivePlayerCash(playerid, -strval(inputtext));
SCM(playerid, COLOR_RED, "Azi nu ai avut noroc si ai {FFFFFF}pierdut{CC0000} $%s!", FormatNumber(strval(inputtext)));
}
case 9: {
GivePlayerCash(playerid, -strval(inputtext));
SCM(playerid, COLOR_RED, "Azi nu ai avut noroc si ai {FFFFFF}pierdut{CC0000} $%s!", FormatNumber(strval(inputtext)));
}
case 10:{
GivePlayerCash(playerid, -strval(inputtext));
SCM(playerid, COLOR_RED, "Azi nu ai avut noroc si ai {FFFFFF}pierdut{CC0000} $%s!", FormatNumber(strval(inputtext)));
}
case 11:{
GivePlayerCash(playerid, -strval(inputtext));
SCM(playerid, COLOR_RED, "Azi nu ai avut noroc si ai {FFFFFF}pierdut{CC0000} $%s!", FormatNumber(strval(inputtext)));
}
}
}
va rog ajutor !!Ai 11 case-uri iar tu ai new castig = 1 + random(10); care poate avea valoarea maxima 10, deci case 11 nu o sa fie niciodata atins. Pune new castig = 1 + random(11); si revino cu reply.
Edit: iar la toate mesajele SCM, cred ca ai vrut sa pui SCMf (cel mai probabil ai functia asta definita in gm) pentru ca folosesti %s. Sau daca nu poti face cu format.
new string[144];
format(string, sizeof(string), "Azi nu ai avut noroc si ai {FFFFFF}pierdut{CC0000} $%s!", FormatNumber(strval(inputtext)));
SCM(playerid, COLOR_RED, string);
-
-
6 minutes ago, Banditul said:
#include <a_samp> main() { new bool:test = true; new nowTime = gettime(); printf("Timestamp now: %i", nowTime); for (new i = 0; i < 1000000; i++) { if (test) { SendClientMessage(0, -1, "Mesaj"); test = false; } else { SendClientMessage(0, -1, "Mesaj"); test = true; } } new elapsedTime = gettime() - nowTime; printf("Elapsed time: %i", elapsedTime); printf("Timestamp now: %i", gettime()); }
Un test destul de simplu as zice, un loop care genereaza 1 milion de verificari if pentru care valoarea variabilei verificate se schimba mereu.
Rezultat
Timestamp now: 1655379502 Elapsed time: 0 Timestamp now: 1655379502
Nu a durat nici macar 1 secunda ca verificarile sa fie facute.
Sfatul meu: Don't fall into the rabbit hole . Nu iti bate capul cu micro optimizari e pierdere de timp, daca consideri ca scriptul tau ruleaza incet adauga pluginul profiler si vezi ce mai exact iti cauzeaza probleme. In cel mai rau caz probabil un if iti va lua 0.00000000000001s din timpul procesorului sa faca verificarea.
Edit: Poate daca serverul pe care rulezi scriptul foloseste un procesor mai vechi/mai lent de Pentium IV poate poate un if in plus conteaza
Multumesc frumos
foreach
in Ajutor Scripting
Posted · Edited by TheGodfather
Am reusit sa rezolv asta, dar cand pornesc serverul pe localhost imi spune asta:
EDIT:
Am pus asta la inceput de gamemode #define CGEN_MEMORY 100000 dar primesc alte erori, pe langa astea 2:
EDIT 2: Asta am rezolvat punand #define MAX_COMMANDS 1000 la inceput de gamemode. Legat de acele scriptfiles, ce pot face?