Jump to content

Yamato

Membru
  • Posts

    48
  • Joined

  • Last visited

Everything posted by Yamato

  1. Yamato

    Bug /heal.

    intr-o casa , este normal sa iti dea heal cu armura cu tot (daca esti in departament) , uite o comanda facuta pentru server-ul meu , poate gasesti ce ai nevoie : //-----------------------------------[HEAL]------------------------------------------------------------------------- if(strcmp(cmd, "/heal", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); GetPlayerName(playerid, sendername, sizeof(sendername)); new location = PlayerInfo[playerid][pLocal]; new virtualworld = PlayerInfo[playerid][pVirWorld]; if(!strlen(tmp)) { if(location != 255 || virtualworld != 255) { if(location < 199) { if(PlayerInfo[playerid][pInt] == 1 && PlayerInfo[playerid][pLocal] == 99 || PlayerInfo[playerid][pInt] == 0 && PlayerInfo[playerid][pLocal] == 103){ return 1;} //PlayerInfo[playerid][pInt] == 0 && PlayerInfo[playerid][pLocal] == 100 if(HouseInfo[location][hArm] == 1 && IsACop(playerid)) { format(string, sizeof(string), "* %s puts on body armour.", sendername); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); SetPlayerArmour(playerid, 100.0); } else { format(string, sizeof(string), "This place does not have armour upgrades."); SendClientMessage(playerid, TEAM_GREEN_COLOR,string); } if(HouseInfo[location][hHel] == 1) { new Float:tempheal; GetPlayerHealth(playerid,tempheal); if ( tempheal < 100.0) { SetPlayerHealth(playerid,100.0); PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0); format(string, sizeof(string), "You have been healed to 100 health."); SendClientMessage(playerid, TEAM_GREEN_COLOR,string); } else { SendClientMessage(playerid, TEAM_GREEN_COLOR,"You are already healed to 100."); } } else { format(string, sizeof(string), "This place does not have healing upgrades."); SendClientMessage(playerid, TEAM_GREEN_COLOR,string); } return 1; } if(PlayerInfo[playerid][pJailed] == 1) { SendClientMessage(playerid,COLOR_GREY," You can`t use this command, you are in jail !"); return 1; } else if(location == 101)//Restaurant { new Float:tempheal; GetPlayerHealth(playerid,tempheal); if ( tempheal < 100.0) { SetPlayerHealth(playerid,100.0); PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0); format(string, sizeof(string), "You have been healed to 100 health."); SendClientMessage(playerid, TEAM_GREEN_COLOR,string); } else { SendClientMessage(playerid, TEAM_GREEN_COLOR,"You are already healed to 100."); } } else if(virtualworld == 400 || virtualworld == 401 || virtualworld == 402 || virtualworld == 403 || virtualworld == 404 || virtualworld == 405 || virtualworld == 406)//training { new Float:tempheal; GetPlayerHealth(playerid,tempheal); if ( tempheal < 100.0) { SetPlayerHealth(playerid,100.0); PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0); format(string, sizeof(string), "You have been healed to 100 health."); SendClientMessage(playerid, TEAM_GREEN_COLOR,string); } else { SendClientMessage(playerid, TEAM_GREEN_COLOR,"You are already healed to 100."); } } else if(location == 102 && IsACop(playerid))//Police Armoury { SetPlayerHealth(playerid,100.0); format(string, sizeof(string), "* %s puts on body armour.", sendername); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); TogglePlayerControllable(playerid, 0); GetPlayerPos(playerid, Unspec[playerid][sPx], Unspec[playerid][sPy], Unspec[playerid][sPz]); Unspec[playerid][sPint] = PlayerInfo[playerid][pInt]; Unspec[playerid][sLocal] = PlayerInfo[playerid][pLocal]; SetPlayerPos(playerid,1527.5,-12.1,1002.0); PlayerInfo[playerid][pLocal] = 255; SetPlayerInterior(playerid,99); Spectate[playerid] = 257; } } else { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /heal [playerid/PartOfName] [price]"); return 1; } } giveplayerid = ReturnUser(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /heal [playerid/PartOfName] [price]"); return 1; } moneys = strval(tmp); if(moneys < 1 || moneys > 100) { SendClientMessage(playerid, COLOR_GREY, " Healing price not below 1 or above 100 !"); return 1; } if (giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GRAD1, " You can not heal yourself!"); return 1; } if (IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid); new giveambu = GetPlayerVehicleID(giveplayerid); new playambu = GetPlayerVehicleID(playerid); if(gTeam[playerid] == TEAM_CYAN||PlayerInfo[playerid][pMember]==4||PlayerInfo[playerid][pLeader]==4)//model { if (IsAnAmbulance(playambu) && playambu == giveambu) { new Float:tempheal; GetPlayerHealth(giveplayerid,tempheal); if(tempheal >= 100.0) { SendClientMessage(playerid, TEAM_GREEN_COLOR," That person is fully healed."); return 1; } if(GetPlayerMoney(giveplayerid) < moneys) { SendClientMessage(playerid, TEAM_GREEN_COLOR," That player don`t have money."); return 1; } if(WantedLevel[giveplayerid] >= 1) { SendClientMessage(playerid,COLOR_GREY," You can`t heal this player !"); return 1; } format(string, sizeof(string), "~y~You healed ~n~~w~%s~n~~g~$%d", giveplayer,moneys); GameTextForPlayer(playerid, string, 5000, 1); GivePlayerMoney(playerid,moneys); GivePlayerMoney(giveplayerid,-moneys); new hp = 0; if(PlayerInfo[playerid][pPainPerk] > 0) { hp = 20 * PlayerInfo[playerid][pPainPerk]; hp += 100; SetPlayerHealth(giveplayerid, hp); } else { hp = 100; SetPlayerHealth(giveplayerid, 100); } PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0); PlayerPlaySound(giveplayerid, 1150, 0.0, 0.0, 0.0); format(string, sizeof(string), "You have been healed to %d health -$%d",hp,moneys); SendClientMessage(giveplayerid, TEAM_GREEN_COLOR,string); if(STDPlayer[giveplayerid] > 0) { STDPlayer[giveplayerid] = 0; SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "* You are no longer infected with a STD anymore because of the Medics help !"); } } else if(PlayerInfo[playerid][pKit] > 0 && !IsAnAmbulance(playambu)) { new Float:tempheal; GetPlayerHealth(giveplayerid,tempheal); if(tempheal >= 100.0) { SendClientMessage(playerid, TEAM_GREEN_COLOR," That person is fully healed."); return 1; } if(GetPlayerMoney(giveplayerid) < moneys) { SendClientMessage(playerid, TEAM_GREEN_COLOR," That person don`t have money."); return 1; } if(PlayerInfo[playerid][pInt] == 1 || PlayerInfo[playerid][pLocal] == 100) { SendClientMessage(playerid,COLOR_GREY," You can`t use this command, reason: you are in gunshop or mini-events !"); return 1; } format(string, sizeof(string), "~y~You healed ~n~~w~%s~n~~g~$%d", giveplayer,moneys); GameTextForPlayer(playerid, string, 5000, 1); GivePlayerMoney(playerid,moneys); GivePlayerMoney(giveplayerid,-moneys); new hp = 0; if(PlayerInfo[playerid][pPainPerk] > 0) { hp = 20 * PlayerInfo[playerid][pPainPerk]; hp += 100; SetPlayerHealth(giveplayerid, hp); } else { hp = 100; SetPlayerHealth(giveplayerid, 100); } GetPlayerName(playerid, sendername, sizeof(sendername)); PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0); PlayerPlaySound(giveplayerid, 1150, 0.0, 0.0, 0.0); format(string, sizeof(string), "You have been healed to %d health -$%d by Medic %s",hp,moneys,sendername); SendClientMessage(giveplayerid, TEAM_GREEN_COLOR,string); PlayerInfo[playerid][pKit] -= 1; format(string, sizeof(string), "* You can use healkit for %d times more.", PlayerInfo[playerid][pKit]); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); if(STDPlayer[giveplayerid] > 0) { STDPlayer[giveplayerid] = 0; SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "* You are no longer infected with a STD anymore because of the Medics help !"); } } else { SendClientMessage(playerid, COLOR_GRAD1, " One of you is not in the Ambulance / Chopper or you don't have a healkit!"); return 1; } } else { SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !"); return 1; } } } else { format(string, sizeof(string), " %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_GRAD1, string); } } return 1; }
  2. Nu m-ai inteles ce nu stiu , vreau ca comanda poata fii folosita o singura data , dar , minim lvl 2 , si maxim nu exista , asta nu stiu sa fac
  3. pai nu stiu sa o fac pentru un gm fara mysql , daca ma poate ajuta cineva sa o fac fara chestiile alea de la sql
  4. Salut , am creeat si eu o comanda pentru mysql , comanda /levelup . Aceasta comanda , are ideea , ca poate fii folosita de la orice level 2+ , inclusiv lvl 2 , si sa dea ceva . Chestia e ca nu stiu cum sa o fac pentru un gm fara mysql: CMD:levelup(playerid, params[]) { if(PlayerInfo[playerid][pLevel] < 2) return SCM(playerid,COLOR_GREY,"{98cc2a}You must be level 2 to use this!"); if(PlayerInfo[playerid][pLevelUP] == 0) { new str[30]; PlayerInfo[playerid][pLevel] += 1; SetPlayerScore(playerid, PlayerInfo[playerid][pLevel] ); GivePlayerCash(playerid, 200000); PlayerInfo[playerid][pLevelUP] += 1; mysql_format(SQL,str,sizeof(str),"UPDATE `users` SET `LevelUP` = '1' WHERE `name`='%s'",PlayerInfo[playerid][pNormalName]); mysql_tquery(SQL,str,"",""); Update(playerid, pLevelUPx); Update(playerid, pCashx); SendClientMessage(playerid,COLOR_NEWBIE,"{b5b5b7}Ai primit 1 Level + 200k!"); } else return SCM(playerid,COLOR_GREY,"{98cc2a}Nu mai poti folosi aceasta comanda!"); return 1; }
  5. foloseste asta https://wiki.sa-mp.com/wiki/TextDrawColor , acel cod de culoare il poti gasii din photoshop sau din ipleomax(textdraw editor) ai o gama larga de culori , daca nu te descurci imi zici
  6. Multumesc frumos pentru ajutor
  7. si acesta il pun fix la coordonata obiectului ? adica nu se schimba coordonata
  8. si acel mesaj la obiect ? cum se poate pune ? ( cum ti-am aratat la /mission , etc )
  9. Salutare , am si eu cateva intrebari , la care nu am gasit raspuns : 1. cum se pune un i cu mesaj pe map , sau nu numai i , si laptop si casuta si discheta , unde anume se gasesc acestea si cum pot pune mesaj , ca aici : http://imgur.com/a/yqD58(in cazul acesta disketa si mesajul /mission) sau aici http://imgur.com/a/8T0H3(in cazul acesta acel i si mesajul lui) . 2. Cum pot pune acele semne pe radar , ca in cazul acesta , o disketa pe radar http://imgur.com/a/U71Gb . 3. Aceste tipuri de teleport sau , nu stiu cum se cheama de unde le gasesc , cum le pun http://imgur.com/a/pYHXs , acea sagetuta ... PS : Multumesc mult !
  10. definesti si tu AdminDuty si ce mai ai pe acolo , la inceput pui asta new AdminDuty[MAX_PLAYERS]; , si daca mai e ceva de definit pui tu . Poftim si comanda : if(strcmp(cmd, "/aod", true) == 0) { if (PlayerInfo[playerid][pAdmin] >= 1) { if(AdminDuty[playerid] == 1) { GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "Admin %s is now off duty.", sendername,playerid); SendClientMessageToAll(COLOR_DBLUE,string); AdminDuty[playerid] = 0; SetPlayerHealth(playerid,100); SetPlayerArmour(playerid,0); SetPlayerToTeamColor(playerid); } else { GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "Admin %s is now on duty.",sendername,playerid); SendClientMessageToAll(0xFAAFBEFF,string); AdminDuty[playerid] = 1; SetPlayerHealth(playerid,999); SetPlayerArmour(playerid,999); SetPlayerColor(playerid,0xFAAFBEFF); for(new i = 0; i < MAX_PLAYERS; i ++) { if(IsPlayerConnected(i)) { SetPlayerMarkerForPlayer( i,playerid,0xFAAFBEFF ); } } } } else { SendClientMessage(playerid,COLOR_GREY,"Your not an admin !"); } return 1; }
  11. buna observatie , am rectificat la pc , si acum merge , multumesc tuturor
  12. La acest printf arata asa Ce mi-ai dat tu , la fel arata in joc , ora 23:39 , ora nu o arata bine , minutele sunt corecte , nu imi pot imagina ce o fi
  13. eu doar am inlocuit , ca sa fac printf cum anume trb sa arate , nu am lucrat niciodata cu asa ceva ....
  14. hai ca incerc sa fac cum ai spus cu %02d:%02d , sa vad daca reusesc EDIT : degeaba , nu functioneaza , problema cred ca e mult mai amanuntita , deoarece face asta si la /time ..
  15. dispui de skype sa vorbim acolo ? (nu stiu cum se da acel printf)
  16. este pe server-ul localhost unde scriptez eu , cum adica sa folosesc %02d ?
  17. Poftim : Sa stii ca poza e facuta chiar acum , deci normal ar trebuii sa arate 20:31
  18. Salutare ! Am si eu o problema cu ora pe server . Am comanda /time care imi arata ora , si am si un ceas facut de mine . Eh , problema e ca , spre exemplu , acum e ora 19 , pe server imi arata ora 9 si minutele le indica corect , codul de la ceas este acesta : ceas si data : #include <a_samp> #define FILTERSCRIPT new Text:Time, Text:Date; forward settime(playerid); public OnFilterScriptInit() { print("\n--------------------------------------"); print("Yamato"); print("--------------------------------------\n"); SetTimer("settime",1000,true); Date = TextDrawCreate(547.000000,11.000000,"--"); TextDrawFont(Date,3); TextDrawLetterSize(Date,0.399999,1.600000); TextDrawColor(Date,0xffffffff); Time = TextDrawCreate(547.000000,28.000000,"--"); TextDrawFont(Time,3); TextDrawLetterSize(Time,0.399999,1.600000); TextDrawColor(Time,0xffffffff); return 1; } public OnFilterScriptExit() { print("\n-----------------------------------------------------"); print("Yamato"); print("-----------------------------------------------------/n"); return 1; } public OnPlayerSpawn(playerid) { TextDrawShowForPlayer(playerid, Time), TextDrawShowForPlayer(playerid, Date); return 1; } public OnPlayerDisconnect(playerid, reason) { TextDrawHideForPlayer(playerid, Time), TextDrawHideForPlayer(playerid, Date); return 1; } public settime(playerid) { new string[256],year,month,day,hours,minutes; getdate(year, month, day), gettime(hours, minutes); format(string, sizeof string, "%d/%s%d/%s%d", day, ((month < 10) ? ("0") : ("")), month, (year < 10) ? ("0") : (""), year); TextDrawSetString(Date, string); format(string, sizeof string, "%s%d:%s%d", (hours < 10) ? ("0") : (""), hours, (minutes < 10) ? ("0") : (""), minutes); TextDrawSetString(Time, string); } si comanda /time : if(strcmp(cmd, "/time", true) == 0) { if(IsPlayerConnected(playerid)) { new mtext[20]; new year, month,day; getdate(year, month, day); if(month == 1) { mtext = "January"; } else if(month == 2) { mtext = "February"; } else if(month == 3) { mtext = "March"; } else if(month == 4) { mtext = "April"; } else if(month == 5) { mtext = "May"; } else if(month == 6) { mtext = "June"; } else if(month == 7) { mtext = "Juli"; } else if(month == 8) { mtext = "August"; } else if(month == 9) { mtext = "September"; } else if(month == 10) { mtext = "October"; } else if(month == 11) { mtext = "November"; } else if(month == 12) { mtext = "December"; } new hour,minuite,second; gettime(hour,minuite,second); FixHour(hour); hour = shifthour; if (minuite < 10) { if (PlayerInfo[playerid][pJailTime] > 0) { format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|~n~~w~Jail Time Left: %d sec", day, mtext, hour, minuite, PlayerInfo[playerid][pJailTime]-10); } else { format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|", day, mtext, hour, minuite); } } else { if (PlayerInfo[playerid][pJailTime] > 0) { format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|~n~~w~Jail Time Left: %d sec", day, mtext, hour, minuite, PlayerInfo[playerid][pJailTime]-10); } else { format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|", day, mtext, hour, minuite); } } GameTextForPlayer(playerid, string, 5000, 1); } return 1; } Cum pot rezolva , am nevoie neaparat , Multumesc Frumos !
  19. faza e ca nu am idee cum sa il fac mai mare ca acea data e prea mica , nu inteleg cum o pot marii , am incercat cu editor textdraw si nu merge deloc
  20. asta rezolva tot si creeaza automat ceasu si data aia ?
  21. Problema intalnita (descriere): Am creat un ceas si o data ( intentia mea fiind de a arata ca aici : http://imgur.com/a/zHvK9 ) dar altul a fost rezultatul http://imgur.com/a/nC4hd . As dorii sa arate ca in prima imagine acel ceas si acea data , doar ca deloc nu reusesc sa le fac .Ero(area / rile) / warning-(ul / urile): eroare este ca nu pot deloc sa il fac , am incercat si cu editor textdraw , dar degeaba .Liniile de cod / sursa / script-ul(obligatoriu): Date = TextDrawCreate(549.599975, 11.946655, "--"); TextDrawLetterSize(Date, 0.317999, 1.450666); TextDrawAlignment(Date, 1); TextDrawColor(Date, -1); TextDrawSetShadow(Date, 0); TextDrawSetOutline(Date, 1); TextDrawBackgroundColor(Date, 0x00000000); TextDrawFont(Date, 3); TextDrawSetProportional(Date, 1); Time = TextDrawCreate(549.599975, 23.893365, "--"); TextDrawLetterSize(Time, 0.634799, 2.406399); TextDrawAlignment(Time, 1); TextDrawColor(Time, -1); TextDrawSetShadow(Time, 0); TextDrawSetOutline(Time, 1); TextDrawBackgroundColor(Time, 0x00000000); TextDrawFont(Time, 3); TextDrawSetProportional(Time, 1); Imagini / Video (optional): as dorii sa arate asa : http://imgur.com/a/zHvK9 , dar arata asa http://imgur.com/a/nC4hdAti incercat sa rezolvati singur?: de nenumarate ori, dar degeaba
×
×
  • 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.