-
Posts
519 -
Joined
-
Last visited
-
Days Won
7
Community Answers
-
andy47's post in Problema inregistrare (Gamemode Edison #4) was marked as the answer
Ca sa numai facem 100 de postari, ai discordul meu la profil.
-
andy47's post in problema script was marked as the answer
enum pEnum { Name[MAX_PLAYER_NAME], Password[32], Admin, Money, }; new UserStats[MAX_PLAYERS][pEnum]; new AccountExists[MAX_PLAYERS]; new PlayerLogged[MAX_PLAYERS]; Astea trebuie mutate mai sus.
http://pastebin.com/qwZfxSvK
-
andy47's post in Problema NRG-500 was marked as the answer
Salut! Incearca sa pleci de la idee asta de baza, adaugi tu codurile acolo care le mai vrei. Eu am pus-o sub forma de comanda deoarece nu stau sa tot verific cat este ora:
public OnPlayerEnterCheckpoint(playerid) { if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 522) { if(stunton[playerid] == 1) { //new playername[25]; //GetPlayerName(playerid, playername, sizeof(playername)); //new randmoney = 3500 + random(90000); DisablePlayerCheckpoint(playerid); stunton[playerid] = 0; RemovePlayerMapIcon(playerid, 1274); DestroyPickup(pickup_event); //format(string,sizeof(string),"{CF165D}%s A castigat STUNT-ul, acesta a castigat %d$.", playername, randmoney); //SendClientMessageToAll( -1, string); //GivePlayerCash(playerid, randmoney); //Update(playerid, pCashx); SendClientMessage(playerid, -1, "Un nou stunt incepe la 3 minute."); SendClientMessage(playerid, -1, "STUNT-ul este in perioada de probe Nu este finalizat."); SendClientMessage(playerid, -1, "Ai gasit-o pe Elodia!"); } } return 1; } CMD:estetimpul(playerid, params[]) { SetTimerEx("bestandy", 1000, false, "i", playerid); return ( true ) ; } forward bestandy(playerid); public bestandy(playerid) { for(new i = 0; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { new randoms = random(sizeof(stuntnrg)); { SetPlayerCheckpoint(i, stuntnrg[randoms][0], stuntnrg[randoms][1], stuntnrg[randoms][2], 1.0); SetPlayerMapIcon(playerid, 53, stuntnrg[randoms][0], stuntnrg[randoms][1], stuntnrg[randoms][2], 53, MAPICON_GLOBAL); pickup_event = CreatePickup(1274, 2, stuntnrg[randoms][0], stuntnrg[randoms][1], stuntnrg[randoms][2], GetPlayerVirtualWorld(playerid)); SendClientMessageToAll(-1, "A new stunting event has just started. It has been marked on your Map with a Black&White Race Flag Get there first and you'II win."); stunton[playerid] = 1; } } } return ( true ) ; }
-
andy47's post in (576) : warning 219: local variable "rows" shadows a variable at a preceding level was marked as the answer
Incearca asa:
public OnPlayerLoadVehicles(playerid) { new raws = cache_num_rows(handle), count = 0, tempString[16]; if(raws > 0) { new tempInt; for(new z = 0; z < raws; z++) { for(new i = 0; i < MAX_VEH; i++) { if(Vehicles[i][vehStatus]) continue; Vehicles[i][vehStatus] = true; Vehicles[i][vehID] = cache_get_field_content_int(z, "id"); Vehicles[i][vehModel] = cache_get_field_content_int(z, "model"); cache_get_field_content(z, "owner", tempString); format(Vehicles[i][vehOwner], MAX_PLAYER_NAME, "%s", tempString); Vehicles[i][vehPos][0] = cache_get_field_content_float(z, "posX"); Vehicles[i][vehPos][1] = cache_get_field_content_float(z, "posY"); Vehicles[i][vehPos][2] = cache_get_field_content_float(z, "posZ"); Vehicles[i][vehPos][3] = cache_get_field_content_float(z, "posA"); Vehicles[i][vehColor][0] = cache_get_field_content_int(z, "color1"); Vehicles[i][vehColor][1] = cache_get_field_content_int(z, "color2"); Vehicles[i][vehInt] = cache_get_field_content_int(z, "int"); Vehicles[i][vehVW] = cache_get_field_content_int(z, "vw"); new a = 1; for(new w = 0; w < 14; w++) { format(tempString, sizeof(tempString), "mod%d", a); Vehicles[i][vehMods][w] = cache_get_field_content_int(z, tempString); a++; } tempInt = cache_get_field_content_int(z, "locked"); if(tempInt == 1) Vehicles[i][vehLock] = true; else Vehicles[i][vehLock] = false; tempInt = cache_get_field_content_int(z, "alarm"); if(tempInt == 1) Vehicles[i][vehAlarm] = true; else Vehicles[i][vehAlarm] = false; cache_get_field_content(z, "plate", tempString); format(Vehicles[i][vehPlate], 16, "%s", tempString); createVehicle(i); count++; break; } } } printf("Loaded %d vehicles from %s", count, GetName(playerid)); return 1; }
-
andy47's post in Ajutor. was marked as the answer
Poftim, aveai multe " ; " in plus, multe virgule si la SetPlayerInterior nu ai specificat niciun interior si l-ai lasat asa.
//---------------------------------------------------------- // // KEEPAROUND RPG 0.1 // Aceasta este o versiune beta, nu este garantat ca v-a merge 100% // //---------------------------------------------------------- #include <a_samp> #include <core> #include <float> #include "../include/gl_common.inc" #include "../include/gl_spawns.inc" //---------------------------------------------------------- #define COLOR_WHITE 0xFFFFFFFF #define COLOR_NORMAL_PLAYER 0xFFBB7777 // aici incercai tu ceva dar mai documenteazate #define rosu "{00FFFF}" #define alb "{FFFFFF}" //new thisanimid=0; //new lastanimid=0; //---------------------------------------------------------- enum PlayerInfo { pLevel, pAdmin, pExp, pLevel, string[128], pLevel, pExp, pCash, Kills, Deaths, Jailed, Muted, Warns, Deposit, Donator // aici nu se pune virgula } ; new pInfo[MAX_PLAYERS][PlayerInfo]; // aici nu aveai ; //---------------------------------------------------------- public OnPlayerSpawn(playerid) { if(pInfo[playerid][pAdmin] >= 1) { SendClientMessage(playerid, 0x00FFFF, "Factura ta medicala este de $20. O zi buna!"); SetPlayerPos(playerid, 2366.3879,1682.2337,14.2811); SetPlayerSkin(playerid, 217); SetPlayerInterior(playerid, 0); // aici la interior nu ai dat nicio valoare, ti-am pus eu 0 GivePlayerMoney(playerid, -20); } // tot ; if(pInfo[playerid][pLevel] >= 1) { SetPlayerSkin(playerid, 177); SetPlayerPos(playerid, 2444.0042,1662.9326,10.8203); SendClientMessage(playerid, 0x00FFFF, "Factura ta medicala este de $30. O zi buna!"); SetPlayerInterior(playerid, 0); // la fel GivePlayerMoney(playerid, -30); } // tot ai pus ; else { SetPlayerSkin(playerid, 180); SetPlayerPos(playerid, 2444.0042,1662.9326,10.8203); SendClientMessage(playerid, 0x00FFFF, "Factura ta medicala este de $50. O zi buna!"); SetPlayerInterior(playerid, 0); // la fel GivePlayerMoney(playerid, -50); } return 1; } //---------------------------------------------------------- public OnPlayerRequestClass(playerid, classid) { if(pInfo[playerid][pAdmin] >= 1) { SetPlayerSkin(playerid, 217); SetPlayerPos(playerid, 2366.3879,1682.2338,14.2811); } // aici tu ai pus ; , nu trebuie pus aici else if(pInfo[playerid][pLevel] >= 1) { SetPlayerSkin(playerid, 177); SetPlayerPos(playerid, 2444.0042,1662.9326,10.8203,260.3592); } // la fel ca sus else { SetPlayerSkin(playerid, 180); SetPlayerPos(playerid, 2444.0042,1662.9326,10.8203,260.3592); // aici aveai mute virgule } return 1; } //---------------------------------------------------------- public OnGameModeInit() { SetGameModeText("RP v0.1"); ShowNameTags(1); SetNameTagDrawDistance(40.0); EnableStuntBonusForAll(); DisableInteriorEnterExits(); SetWeather(2); } //---------------------------------------------------------- Si vezi ca astea:
C:\Users\a\Desktop\Folder nou (2)\gamemodes\grandlarc.pwn(137) : warning 203: symbol is never used: "gArmySpawns" C:\Users\a\Desktop\Folder nou (2)\gamemodes\grandlarc.pwn(137) : warning 203: symbol is never used: "gMedicalSpawns" C:\Users\a\Desktop\Folder nou (2)\gamemodes\grandlarc.pwn(137) : warning 203: symbol is never used: "gPoliceSpawns" C:\Users\a\Desktop\Folder nou (2)\gamemodes\grandlarc.pwn(137) : warning 203: symbol is never used: "gRandomSpawns_LasVenturas" C:\Users\a\Desktop\Folder nou (2)\gamemodes\grandlarc.pwn(137) : warning 203: symbol is never used: "gRandomSpawns_LosSantos" C:\Users\a\Desktop\Folder nou (2)\gamemodes\grandlarc.pwn(137) : warning 203: symbol is never used: "gRandomSpawns_SanFierro" le primeste pentru ca nu ai folosit nicaieri functiile astea, daca nu vrei sa-ti mai apara si nu ai de gand sa le folosesti vreodata sterge:
#include "../include/gl_spawns.inc" -
andy47's post in Problema la schimbare nume mode si gamemode was marked as the answer
Pai compileazal in calculator si dupa pune fisierul .amx pe host si da-i un restart la server. Data viitoare respecta modelul!
-
andy47's post in Eroare Compilare was marked as the answer
if(!strcmp(cmdtext, "/event", true) || !strcmp(cmdtext, "/event", true)) // By MrAndrei { if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te loghezi mai intai."); if(activeevent == 0) return SendClientMessage(playerid, COLOR_DS, "{FFFF45}There is currently no active event running."); new gstring[500],name[MAX_PLAYER_NAME]; foreach(Player, i) { if(eventorganizer == 1) { GetPlayerName(i, name, sizeof(name)); } } format(gstring, sizeof(gstring), "{FFFF00}Event: Title: %s Prize: $%s Location: %s Time: %s",eventtitle,FormatNumber(eventprize), eventlocation, eventtime); SendClientMessage(playerid, 0xFFFFFFFF, gstring); format(gstring, sizeof(gstring), "{FFFF00}Event: Organizer: %s Description: %s",name,eventdescription); SendClientMessage(playerid, 0xFFFFFFFF, gstring); return 1; } Incearca asa.
-
andy47's post in Porblema citire/scriere km was marked as the answer
Pai km astia definestei ca un float. Si acolo la update adaugi:
new query[MAX_STRING]; format(query, sizeof(query), "UPDATE `cars` SET `KM`='%0.2f' WHERE `id`='%d'", CarData[i-PreVehicle][cKM], i-PreVehicle); mysql_query(query); Mergi la
new CarData si acolo deasuprea la enum adaugi inloc de cKM
Float:cKM Peste tot unde setezi ca variabila asta sa fie 0 inloc de 0 pui 0.0 exemplu:
CarData[i-PreVehicle][cKM] = 0.0; // deoarece e float Mergi la :
sscanf(Query, "p<|>e<iiffffffffiis[64]s[64]iiiiis[255]iiiiiiiiiiiiiii>",CarData[idx]); si inlocuieste "i" cu "f" .
La textdraw inloc de "%d" inlocuieste cu "%.2f".
La functia CheckGas inlocuieste:
CarData[i-PreVehicle][cKM]++; cu:
CarData[i-PreVehicle][cKM] += (Carspeed(i)*0.27)/700; si functia pentru Carspeed:
stock Carspeed(playerid,mode = 1) { new Float:Velocity [3]; GetVehicleVelocity ( GetPlayerVehicleID ( playerid ) , Velocity [ 0 ] , Velocity [ 1 ] , Velocity [ 2 ] ) ; return IsPlayerInAnyVehicle ( playerid ) ? floatround ( ( ( floatsqroot ( ( ( Velocity [ 0 ] * Velocity [ 0 ] ) + ( Velocity [ 1 ] * Velocity [ 1 ] ) + ( Velocity [ 2 ] * Velocity [ 2 ] ) ) ) * ( !mode ? 105.0 : 170.0 ) ) ) * 1 ) : 0; } -
andy47's post in Problema cars was marked as the answer
Credca folosesti system de masini personale a lui I_Bank ( sau cum il cheama ). Cauta in gm
new carsonserver = folosind CTRL+F, si inlocuieste cu
new carsonserver = 0; daca nu merge cu 0 incearca si cu 1 .
Dupa cauti in gm ca ai ceva de genul asta:
new CarInfo[254][cInfo]; si inlocuieste 254 cu 0.
Masinile trebuie toate sterse din .cfg si dupa faci asta.
-
andy47's post in Problema radio was marked as the answer
Dute la callback-ul OnPlayerExitVehicle si adauga:
public OnPlayerExitVehicle(playerid, vehicleid) { PlayAudioStreamForPlayer(playerid, "Radio oprit."); StopAudioStreamForPlayer(playerid); return 1; } -
andy47's post in Problema /sellcar /asellcar was marked as the answer
Incearca comanda asta:
if(strcmp(cmd, "/sellcar", true) == 0||strcmp(cmd, "/sellboat", true) == 0||strcmp(cmd, "/sellbike", true) == 0||strcmp(cmd, "/sellaero", true) == 0) { if(IsAtDealership(playerid)) { new vehid; if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey1]) { vehid = PlayerInfo[playerid][pPcarkey1]; } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { vehid = PlayerInfo[playerid][pPcarkey2]; } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { vehid = PlayerInfo[playerid][pPcarkey3]; } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey4]) { vehid = PlayerInfo[playerid][pPcarkey4]; } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey5]) { vehid = PlayerInfo[playerid][pPcarkey5]; } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey6]) { vehid = PlayerInfo[playerid][pPcarkey6]; } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey7]) { vehid = PlayerInfo[playerid][pPcarkey7]; } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey8]) { vehid = PlayerInfo[playerid][pPcarkey8]; } else { return 1; } new Float:x, Float:y, Float:z, Float:a; GetVehiclePos(vehid, x, y, z); GetVehicleZAngle(vehid, a); GetPlayerName(playerid, sendername, sizeof(sendername)); if(strcmp(sendername, CarInfo[vehid][cOwner], true) == 0) { new vehi = GetPlayerVehicleID(playerid); new carsellprice = CarInfo[vehid][cValue] / 2; format(string, sizeof(string), "~w~ai vandut masina pentru: ~n~~g~$%d", carsellprice); GameTextForPlayer(playerid, string, 1000, 3); strmid(CarInfo[vehid][cOwner], "None", 0, strlen("None"), 999); strmid(CarInfo[vehid][cDescription], "None", 0, strlen("None"), 999); strmid(CarInfo[vehid][cNume], "None", 0, strlen("None"), 999); CarInfo[vehid][cModel] = 0; CarInfo[vehid][cLocationx] = 0.0; CarInfo[vehid][cLocationy] = 0.0; CarInfo[vehid][cLocationz] = 0.0; CarInfo[vehid][cAngle] = 0.0; CarInfo[vehid][cColorOne] = 0; CarInfo[vehid][cColorTwo] = 0; CarInfo[vehid][cValue] = 0; CarInfo[vehid][cLicense] = 0; CarInfo[vehid][cOwned] = 0; CarInfo[vehid][cLock] = 0; CarInfo[vehid][cOras] = 0; CarInfo[vehid][cNumar] = 0; CarInfo[vehid][cMod1] = 0; CarInfo[vehid][cMod2] = 0; CarInfo[vehid][cMod3] = 0; CarInfo[vehid][cMod4] = 0; CarInfo[vehid][cMod5] = 0; CarInfo[vehid][cMod6] = 0; CarInfo[vehid][cMod7] = 0; CarInfo[vehid][cMod8] = 0; CarInfo[vehid][cMod9], = 0; CarInfo[vehid][cMod10] = 0; CarInfo[vehid][cMod11] = 0; CarInfo[vehid][cMod12] = 0; CarInfo[vehid][cMod13] = 0; CarInfo[vehid][cMod14] = 0; CarInfo[vehid][cMod15] = 0; CarInfo[vehid][cMod16] = 0; CarInfo[vehid][cMod17] = 0; CarInfo[vehid][cPaintJob] = 0; CarInfo[vehid][cDist] = 0; CarInfo[vehid][cLockTrunk] = 0; CarInfo[vehid][cAlarmInst] = 0; CarInfo[vehid][cAlarm] = 0; CarInfo[vehid][cDate ] = 0; CarInfo[vehid][cNeon] = 0; CarInfo[vehid][cNeonActiv] = 0; CarInfo[vehid][cBass] = 0; RemovePlayerFromVehicle(playerid); DestroyVehicle(vehi); OnPropUpdate(); OnPlayerUpdateEx(playerid); SafeGivePlayerMoney(playerid,carsellprice); if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey1]) { PlayerInfo[playerid][pPcarkey1] = 9999; } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { PlayerInfo[playerid][pPcarkey2] = 9999; } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { PlayerInfo[playerid][pPcarkey3] = 9999; } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey4]) { PlayerInfo[playerid][pPcarkey4] = 9999; } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey5]) { PlayerInfo[playerid][pPcarkey5] = 9999; } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey6]) { PlayerInfo[playerid][pPcarkey6] = 9999; } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey7]) { PlayerInfo[playerid][pPcarkey7] = 9999; } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey8]) { PlayerInfo[playerid][pPcarkey8] = 9999; } TogglePlayerControllable(playerid, 1); return 1; } else { SendClientMessage(playerid, COLOR_GREY, " Nu esti in masina ta! "); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "Nu esti la centrul de vanzare"); return 1; } }