NuamNume
-
Posts
70 -
Joined
-
Last visited
Content Type
Profiles
Forums
News
Documentation
Posts posted by NuamNume
-
-
Nu merge
-
Salut, o problema in care mereu cand ma loghez, imi da payday-ul.
COD:
task SecondTimer[1000]() / asta nu stiu daca conteaza dar mna
{
new string[64];
new hour, minute, second, year, month, day;
gettime(hour, minute, second);
getdate(year, month, day);
format(string, sizeof string, "%02d.%02d.%d~N~%02d:%02d:%02d", day, month, year, hour, minute, second);
TextDrawSetString(ServerTimeTD, string);
format(string, sizeof string, "T: ~Y~%d~W~~H~ Q: ~B~%d", GetServerTickRate(), mysql_unprocessed_queries());
TextDrawSetString(ServerInfoTD, string);
return true;
}ptask SecondPlayerTimer[1000](playerid)
{
if(IsPlayerPaused(playerid) || IsPlayerInRangeOfPoint(playerid, 1.0, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]))
{
PlayerInfo[playerid][pAFKSeconds] ++;
}
else
{
PlayerInfo[playerid][pAFKSeconds] = 0;
}
if(PlayerInfo[playerid][pAFKSeconds] < 10)
{
PlayerInfo[playerid][pSeconds] ++;
}
if(PlayerInfo[playerid][pPayday] <= gettime())
{
SendClientMessage(playerid, 0x00b3b3FF, "---------------------------------------------------------");
SendFormatMessage(playerid, COLOR_WHITE, "Paycheck: $%s, Hours Played: %.2f (%.0f minutes).", FormatNumber(PlayerInfo[playerid][pLevel] * 125), (PlayerInfo[playerid][pSeconds] / 3600), (PlayerInfo[playerid][pSeconds] / 60));
SendClientMessage(playerid, 0x00b3b3FF, "---------------------------------------------------------");PlayerInfo[playerid][pHours] += (PlayerInfo[playerid][pSeconds] / 3600);
PlayerInfo[playerid][pSeconds] = 0;
PlayerInfo[playerid][pPayday] = (gettime() + 3600);
PlayerInfo[playerid][pRespectPoints] ++;
if(PlayerInfo[playerid][pDrivingLic] > 0)
PlayerInfo[playerid][pDrivingLic] --;if(PlayerInfo[playerid][pWeaponLic] > 0)
PlayerInfo[playerid][pWeaponLic] --;if(PlayerInfo[playerid][pBoatLic] > 0)
PlayerInfo[playerid][pBoatLic] --;if(PlayerInfo[playerid][pFlyLic] > 0)
PlayerInfo[playerid][pFlyLic] --;if(PlayerInfo[playerid][pDrivingLicS] > 0)
PlayerInfo[playerid][pDrivingLicS] --;if(PlayerInfo[playerid][pWeaponLicS] > 0)
PlayerInfo[playerid][pWeaponLicS] --;if(PlayerInfo[playerid][pBoatLicS] > 0)
PlayerInfo[playerid][pBoatLicS] --;if(PlayerInfo[playerid][pFlyLicS] > 0)
PlayerInfo[playerid][pFlyLicS] --;
GivePlayerMoneyEx(playerid, (PlayerInfo[playerid][pLevel] * 125));
UpdateLevelBar(playerid);
mysqlQuery("UPDATE `users` SET `Hours` = '%f', `Seconds` = '0', `Payday` = '3600', `RespectPoints` = '%d' `Licenses` = '%d|%d|%d|%d|%d|%d|%d|%d' WHERE `ID` = '%d'", PlayerInfo[playerid][pHours], PlayerInfo[playerid][pRespectPoints], PlayerInfo[playerid][pSQLID]);
}
new string[64];
format(string, sizeof string, "Next payday in ~Y~%s", Calculate(PlayerInfo[playerid][pPayday] - gettime()));
PlayerTextDrawSetString(playerid, PaydayPTD[playerid], string);
GetPlayerPos(playerid, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]);
return true;
} -
12 hours ago, [El.Capo] said:
in loc de return 1; pune return false; sau return 0;
Mersi mult bro, un t/c va rog.
-
Poate sa ma ajute cineva?
Problema: imi scrie in chat de 2 ori...
Poza // In game: "https://imgur.com/a/jELYlVb"
COD:
public OnPlayerText(playerid, text[])
{
if(IsPlayerLogged(playerid))
{
if(PlayerInfo[playerid][pMute] > gettime())
{
SendFormatMessage(playerid, 0xe88d87FF, "You are muted! You can type again in %d %s.", ((PlayerInfo[playerid][pMute] - gettime()) > 60) ? ((PlayerInfo[playerid][pMute] - gettime()) / 60) : (PlayerInfo[playerid][pMute] - gettime()), ((PlayerInfo[playerid][pMute] - gettime()) > 60) ? ("minutes") : ("seconds"));
return false;
}
SendNearbyMessage(playerid, COLOR_WHITE, 25.0, "%s: %s", GetPlayerNameEx(playerid), text);
SetPlayerChatBubble(playerid, text, COLOR_WHITE, 25.0, 5000);gQuery[0] = (EOS);
mysql_format(SQL, gQuery, sizeof(gQuery), "INSERT INTO `server_chat_log` (Name, Text) VALUES ('%s', '%s')", GetPlayerNameEx(playerid), text);
mysql_pquery(SQL, gQuery, "", "");
}
return 1;
} -
3 hours ago, adversaru said:
nu stiu care dintre noi e prostu' care cere ajutor in disper la orice problema de incepatori.
esti si prost si mandru, bravo.
mersi frate te pup
-
1 hour ago, adversaru said:
de ce spui "am facut un sistem" cand de fapt l-ai copiat? daca stiai tu sa codezi atat, stiai sigur sa rezolvi si o problema banala de genu.
va dati ce nu sunteti, asta e pacatul vostru, si dupa 1 an de copy-paste postati "Ofer servicii scripting".vezi si tu la comanda de dat licente daca-ti seteaza [pBoatLic] pe 1.
lol ce prost
-
Salut, am facut un sistem de licente, totul merge nu am probleme dar cand ma apropii de un avion sau barca, imi zice ca nu am licenta de condus. Dar daca imi setez licenta de condus merge sa urc. La masini este ok.
Cod: public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(!ispassenger)
{
if(!isBike(GetVehicleModel(vehicleid)) && PlayerInfo[playerid][pDrivingLic] == 0)
{
ClearAnimations(playerid);
return SendClientMessage(playerid, COLOR_GREY, "Nu ai licenta de condus.");
}
if(isBoat(GetVehicleModel(vehicleid)) && PlayerInfo[playerid][pBoatLic] == 0)
{
ClearAnimations(playerid);
return SendClientMessage(playerid, COLOR_GREY, "Nu ai licenta de navigatie.");
}
if(isPlane(GetVehicleModel(vehicleid)) && PlayerInfo[playerid][pFlyLic] == 0)
{
ClearAnimations(playerid);
return SendClientMessage(playerid, COLOR_GREY, "Nu ai licenta de pilot.");
}
}
return 1;
}si la statechange
if(newstate == PLAYER_STATE_DRIVER)
{
if(!isBike(GetVehicleModel(GetPlayerVehicleID(playerid))) && PlayerInfo[playerid][pDrivingLic] == 0)
{
SlapPlayer(playerid);
return SendClientMessage(playerid, COLOR_GREY, "Nu ai licenta de condus.");
}
if(isBoat(GetVehicleModel(GetPlayerVehicleID(playerid))) && PlayerInfo[playerid][pBoatLic] == 0)
{
SlapPlayer(playerid);
return SendClientMessage(playerid, COLOR_GREY, "Nu ai licenta de navigatie.");
}
if(isPlane(GetVehicleModel(GetPlayerVehicleID(playerid))) && PlayerInfo[playerid][pFlyLic] == 0)
{
SlapPlayer(playerid);
return SendClientMessage(playerid, COLOR_GREY, "Nu ai licenta de pilot.");
}
}Am un stock gen cu isplane, etc..
-
Multumesc mult, merge. Dar nu se updateaza bara... si doar am pus ala
-
On 5/21/2020 at 5:58 PM, VLM said:
La bara de level zice 100% ? Daca da, arata functia UpdateLevelBar
stock UpdateLevelBar(playerid)
{
if(LevelBar[playerid] != INVALID_PLAYER_BAR_ID)
DestroyPlayerProgressBar(playerid, LevelBar[playerid]);
LevelBar[playerid] = CreatePlayerProgressBar(playerid, 506.00, 140.00, 94.50, 1.50, 1509246463, 100.0);
SetPlayerProgressBarMaxValue(playerid, LevelBar[playerid], (PlayerInfo[playerid][pLevel] * 3));
SetPlayerProgressBarValue(playerid, LevelBar[playerid], PlayerInfo[playerid][pRespectPoints]);
ShowPlayerProgressBar(playerid, LevelBar[playerid]);
new string[64];
format(string, sizeof string, "Level %d (%d/%d RP)", PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pRespectPoints], (PlayerInfo[playerid][pLevel] * 3));
PlayerTextDrawSetString(playerid, LevelPTD[playerid], string);
PlayerTextDrawShow(playerid, LevelPTD[playerid]);
TogglePlayerSpectating(playerid, false);
return true;
}
-
sigur iti spune cineva waller
-
Salut, am o problema la comanda buylevel. Pur si simplu am RP-uri, dar cand dau /buylevel imi zice ca nu am, dar, daca nu am rp-uri tot imi zice ca nu am deci nu stiu ce am facut.
YCMD:buylevel(playerid, params[], help)
{
new respect = (PlayerInfo[playerid][pLevel] * 3), money = (PlayerInfo[playerid][pLevel] * 250);
if(PlayerInfo[playerid][pRespect] < respect)
return SendClientMessage(playerid, COLOR_GREY, "Nu ai destule RP-uri! Foloseste comanda /stats pentru a vedea cate RP-uri ai.");
if(GetPlayerMoney(playerid) < money)
return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money!");
GivePlayerMoneyEx(playerid, -money);
UpdateLevelBar(playerid);
PlayerInfo[playerid][pLevel] ++;
PlayerInfo[playerid][pRespectPoints] -= respect;mysqlQuery("UPDATE `users` SET `RespectPoints` = '%d', `Level` = '%d' WHERE `ID` = '%d'", PlayerInfo[playerid][pRespectPoints], PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pSQLID]);
SendFormatMessage(playerid, COLOR_YELLOW, "Your level is now %d!", PlayerInfo[playerid][pLevel]);
return true;
} -
un cod cv?
-
@Sebastian IoanLasa tepele ca nu-s bune bro.
-
Salut, de o zi am problema asta si nu stiu cum sa o rezolv.
Pur si simplu, daca nu am RP-uri, imi scrie ca nu am, este normal. Dar daca am rp-uri si dau /buylevel imi scrie ca nu am rp-uri... de la ce ar putea sa fie?
YCMD:buylevel(playerid, params[], help)
{
new respect = (PlayerInfo[playerid][pLevel] * 3), money = (PlayerInfo[playerid][pLevel] * 250);
if(PlayerInfo[playerid][pRespect] < respect)
return SendClientMessage(playerid, COLOR_GREY, "Nu ai destule RP-uri! Foloseste comanda /stats pentru a vedea cate RP-uri ai.");
if(GetPlayerMoney(playerid) < money)
return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money!");
GivePlayerMoney(playerid, -money);
UpdateLevelBar(playerid);
PlayerInfo[playerid][pLevel] ++;
PlayerInfo[playerid][pRespectPoints] -= respect;mysqlQuery("UPDATE `users` SET `RespectPoints` = '%d', `Level` = '%d' WHERE `ID` = '%d'", PlayerInfo[playerid][pRespectPoints], PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pSQLID]);
SendFormatMessage(playerid, COLOR_YELLOW, "Your level is now %d!", PlayerInfo[playerid][pLevel]);
return true;
} -
-
arata si codul
-
Nu stiu ce are...
Baza de date:
ID Name Password Email RegisterDate LastLogin 4 R4uL parola123 none 0000-00-00 0000-00-00 ce are fratilor? cod:
gQuery[0] = (EOS);
mysql_format(SQL, gQuery, sizeof gQuery, "INSERT INTO `users` (Name, Password, RegisterDate, LastLogin) VALUES ('%e', '%e', '%e', '%e')", GetPlayerNameEx(playerid), inputtext, GetDateTime());
mysql_pquery(SQL, gQuery, "", ""); // se salveaza (cred) la registeram si functia asta: stock GetDateTime()
{
new string[64], hour, minute, second, year, month, day;
gettime(hour, minute, second);
getdate(year, month, day);
format(string, sizeof string, "%02d:%02d:%02d - %02d/%02d/%0d", hour, minute, second, day, month, year);
SendClientMessageToAll(-1, string);
return string;
} -
16:01:18 05/19/20] [WARNING] CMySQLHandle::Create - connection already exists
-
Am rezolvat.
-
Ah, ok, o sa incerc.
-
ok, cred...
-
Ar fii fost bine, oricum o rezolv eu. Multumesc inca o data!
-
nu cred brooo merge mersi din tot sufletul meu iti raman dator dar trebuie sa mai adaug ceva? ca gen scrie last login 000-000-000 ceva de genu
-
tot de tip date?
Problema Ban Poate sa ma ajute cineva? fast va rog
in Ajutor Scripting
Posted · Edited by NuamNume
Ma poate ajuta cineva? Cand dau de ex /ban PetardaBUM1998 0 NeAuzim imi apare "syntax: /ban etc
Va rog...
COD:
YCMD:ban(playerid, params[], help)
{
if(!PlayerInfo[playerid][pAdmin])
return SCM(playerid, 0xa3e080FF, "You are not an admin!");
if(GetPVarInt(playerid, "ban_cooldown") > gettime())
return SendFormatMessage(playerid, COLOR_GREY, "You need to wait %d seconds for another ban.", (GetPVarInt(playerid, "ban_cooldown") - gettime()));
new userID, days, reason[64];
if(sscanf(params, "usd[64]", userID, days, reason) || days < 0)
return SCM(playerid, -1, "Syntax: /ban <playerid/name> <days (0 = permanent)> <reason>");
if(!IsPlayerLogged(playerid))
return SCM(playerid, COLOR_GREY, "This player is not connected!");
if(userID == playerid)
return SCM(playerid, COLOR_GREY, "Nu poti folosi aceasta comanda aspura ta.");
if(PlayerInfo[playerid][pAdmin] >= PlayerInfo[playerid][pAdmin] && !strmatch(GetPlayerNameEx(playerid), "R4uL"))
return SCM(playerid, COLOR_GREY, "Nu poti folosi aceasta comanda pe acel jucator.");
banPlayer(userID, playerid, days, reason);
return true;
}