Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Includes
- #include <a_samp>
- #include <ocmd>
- #include <sscanf2>
- #include <a_mysql>
- //Colori
- #define COLOR_RED 0xAA3333AA
- #define COLOR_WHITE 0xFFFFFFFF
- #define COLOR_BLUE 0x009BFFFF
- #define COLOR_YELLOW 0xEBFF00FF
- #define COLOR_CHAT 0xFEFEFEFF
- #define COLOR_FADE1 0xE6E6E6FF
- #define COLOR_FADE2 0xD1CFD1FF
- #define COLOR_FADE3 0xBEC1BEFF
- #define COLOR_FADE4 0x919397FF
- //Dialoghi
- #define DIALOG_TELEPORT 1
- #define DIALOG_REGISTER 2
- #define DIALOG_LOGIN 3
- #define DIALOG_AUTOHAUS 4
- //MySQL
- #define db_host "localhost"
- #define db_user "samp"
- #define db_pass "mysqlpasswort"
- #define db_db "samp"
- //Limits
- #define CHAT_RADIUS 40
- #define CHAT_FADES 5
- //enums
- enum playerInfo{
- eingeloggt,
- level,
- db_id,
- alevel,
- fraktion,
- rang,
- spawnchange
- }
- enum hausEnum{
- Float:h_x,
- Float:h_y,
- Float:h_z,
- Float:ih_x,
- Float:ih_y,
- Float:ih_z,
- h_interior,
- h_besitzer[MAX_PLAYER_NAME],
- h_preis,
- h_id,
- h_pickup,
- Text3D:h_text
- }
- enum buildingsEnum{
- Float:b_x,
- Float:b_y,
- Float:b_z,
- Float:b_ix,
- Float:b_iy,
- Float:b_iz,
- b_interior,
- b_shopname[15]
- }
- enum carEnum{
- id_x,
- model,
- besitzer,
- Float:c_x,
- Float:c_y,
- Float:c_z,
- Float:c_r,
- db_id
- }
- enum autohausEnum{
- Float:s_x,
- Float:s_y,
- Float:s_z,
- Float:s_r
- }
- enum autohauscarEnum{
- model,
- Float:c_x,
- Float:c_y,
- Float:c_z,
- Float:c_r,
- c_preis,
- ah_id,
- id_x
- }
- enum fraktEnum{
- f_name[128],
- Float:f_x,
- Float:f_y,
- Float:f_z,
- Float:f_r,
- f_inter,
- f_world,
- f_color
- }
- //Variabili
- new dbhandle;
- new sInfo[MAX_PLAYERS][playerInfo];
- new fInfo[][fraktEnum] = {
- {"Civili", 0.0, 0.0, 0.0, 0.0, 0, 0, COLOR_WHITE},
- {"LSPD", 295.2865,-55.4151,2.7772,293.463, 0, 0, COLOR_BLUE},
- {"Taxi", 0.0, 0.0, 0.0, 0.0, 0, 0, COLOR_YELLOW}
- };
- new bInfo[][buildingsEnum] = {
- {243.0825,-178.3224,1.5822,285.3642,-41.5576,1001.5156,1,"AMMUN1"},//Ammunation
- {212.1142,-202.1886,1.5781,372.4523,-133.5244,1001.4922,5,"FDPIZA"}//Pizza
- };
- new cInfo[50][carEnum];
- new ahInfo[][autohausEnum] = {
- {125.7242,-170.1469,1.2838,177.7335},//id: 0 1. autobus
- {189.8910,-263.3446,1.2829,180.6895}//id: 1 2. autobus
- };
- new ahCars[][autohauscarEnum] = {
- {560,118.5637,-153.0834,1.2834,186.6475,50000,0},
- {411,106.3420,-158.7720,1.7527,257.3197,80000,0},
- {400,204.8894,-265.4756,1.2866,354.1406,10000,1}
- };
- new hInfo[100][hausEnum];
- new sekunden_timer;
- new autosOhneMotor[] = {509,510,481};
- new Text:uhrzeitLabel;
- //Forwards
- forward OnUserCheck(playerid);
- forward OnPasswordResponse(playerid);
- forward carSavedToDB(carid);
- forward OnPlayerCarsLoad(playerid);
- forward OnHausesLoad();
- forward sekunde();
- forward unfreezePlayer(playerid);
- forward OnHausCreated(id);
- main()
- {
- }
- public OnGameModeInit()
- {
- SetGameModeText("script");
- AddPlayerClass(1,1129.0421,-1486.5045,22.7690,1.7888,0,0,0,0,0,0); //
- DisableInteriorEnterExits();
- ManualVehicleEngineAndLights();
- //MySQL
- dbhandle = mysql_connect(db_host,db_user,db_db,db_pass);
- //Edificio
- for(new i=0; i<sizeof(bInfo); i++)
- {
- CreatePickup(1239,1,bInfo[i][b_x],bInfo[i][b_y],bInfo[i][b_z]);
- Create3DTextLabel("Per entrare /entra",COLOR_RED,bInfo[i][b_x],bInfo[i][b_y],bInfo[i][b_z],10,0,1);
- }
- //Auto creabili
- AddStaticVehicle(560,214.1196,-141.3710,1.3052,1.6804,-1,-1); //Sultan
- //Concessionario Patente Auto
- for(new i=0; i<sizeof(ahCars); i++)
- {
- ahCars[i][id_x]=AddStaticVehicle(ahCars[i][model],ahCars[i][c_x],ahCars[i][c_y],ahCars[i][c_z],ahCars[i][c_r],-1,-1);
- }
- //Case di Licenza
- new query[128];
- format(query, sizeof(query), "Seleziona * casa");
- mysql_function_query(dbhandle, query, true, "OnHausesLoad", "");
- //Timer
- sekunden_timer = SetTimer("sekunde",1000,true);
- //Textdraws
- uhrzeitLabel = TextDrawCreate(557.000000, 12.000000, "00:00");
- TextDrawBackgroundColor(uhrzeitLabel, 255);
- TextDrawFont(uhrzeitLabel, 3);
- TextDrawLetterSize(uhrzeitLabel, 0.580000, 2.399999);
- TextDrawColor(uhrzeitLabel, -1);
- TextDrawSetOutline(uhrzeitLabel, 1);
- TextDrawSetProportional(uhrzeitLabel, 1);
- return 1;
- }
- public OnHausesLoad()
- {
- new num_fields,num_rows;
- cache_get_data(num_rows,num_fields,dbhandle);
- if(!num_rows)return 1;
- for(new i=0; i<num_rows; i++)
- {
- new id=getFreeHausID();
- hInfo[id][h_x]=cache_get_field_content_float(i, "h_x", dbhandle);
- hInfo[id][h_y]=cache_get_field_content_float(i, "h_y", dbhandle);
- hInfo[id][h_z]=cache_get_field_content_float(i, "h_z", dbhandle);
- hInfo[id][ih_x]=cache_get_field_content_float(i, "ih_x", dbhandle);
- hInfo[id][ih_y]=cache_get_field_content_float(i, "ih_y", dbhandle);
- hInfo[id][ih_z]=cache_get_field_content_float(i, "ih_z", dbhandle);
- hInfo[id][h_interior]=cache_get_field_content_int(i, "h_interior", dbhandle);
- new tmp_name[MAX_PLAYER_NAME];
- cache_get_field_content(i, "besitzer", tmp_name, dbhandle);
- strmid(hInfo[id][h_besitzer], tmp_name, 0, sizeof(tmp_name), sizeof(tmp_name));
- hInfo[id][h_id]=cache_get_field_content_int(i, "id", dbhandle);
- hInfo[id][h_preis]=cache_get_field_content_int(i, "h_preis", dbhandle);
- updateHaus(id);
- }
- return 1;
- }
- updateHaus(id)
- {
- new string[128];
- if(hInfo[id][h_pickup])
- {
- DestroyPickup(hInfo[id][h_pickup]);
- }
- if(hInfo[id][h_text])
- {
- Delete3DTextLabel(hInfo[id][h_text]);
- }
- if(!strlen(hInfo[id][h_besitzer]))
- {
- hInfo[id][h_pickup]=CreatePickup(1273, 1, hInfo[id][h_x], hInfo[id][h_y], hInfo[id][h_z], -1);
- format(string,sizeof(string), "In Vendita\nCosto: %i$\n/casainvendita", hInfo[id][h_preis]);
- hInfo[id][h_text]=Create3DTextLabel(string, COLOR_RED, hInfo[id][h_x], hInfo[id][h_y], hInfo[id][h_z], 10, 0, 1);
- }
- else
- {
- hInfo[id][h_pickup]=CreatePickup(1239, 1, hInfo[id][h_x], hInfo[id][h_y], hInfo[id][h_z], -1);
- format(string,sizeof(string), "Proprietario: %s\n/entra", hInfo[id][h_besitzer]);
- hInfo[id][h_text]=Create3DTextLabel(string, COLOR_BLUE, hInfo[id][h_x], hInfo[id][h_y], hInfo[id][h_z], 10, 0, 1);
- }
- return 1;
- }
- public OnGameModeExit()
- {
- mysql_close(dbhandle);
- return 1;
- }
- public sekunde()
- {
- new string[128];
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(!IsPlayerConnected(i))continue;
- if(!IsPlayerInAnyVehicle(i))continue;
- format(string,sizeof(string),"%ikm/h", getPlayerSpeed(i));
- GameTextForPlayer(i, string, 1000, 3);
- }
- new hour, minute, second;
- gettime(hour, minute, second);
- format(string,sizeof(string),"%02d:%02d",hour, minute);
- TextDrawSetString(uhrzeitLabel, string);
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid,199.0846,-150.0331,1.5781);
- SetPlayerCameraPos(playerid, 199.2307,-143.8328,1.5781);
- SetPlayerCameraLookAt(playerid, 199.0846,-150.0331,1.5781);
- SetPlayerFacingAngle(playerid,359.1443);
- return 1;
- }
- public OnUserCheck(playerid)
- {
- new num_rows,num_fields;
- cache_get_data(num_rows,num_fields,dbhandle);
- if(num_rows==0)
- {
- //Registrazione
- ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Registrazione","Inserisci una password desiderata:","Ok","Esci");
- }
- else
- {
- //Login
- ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Logga","Si prega di inserire la propria password:","Ok","Esci");
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new nachricht[128];
- format(nachricht,sizeof(nachricht),"Ti sei connesso con ID %i.",playerid);
- SendClientMessage(playerid,COLOR_RED,nachricht);
- //Login/Register
- new name[MAX_PLAYER_NAME],query[128];
- GetPlayerName(playerid,name,sizeof(name));
- format(query,sizeof(query),"Seleziona il giocatore='%s'",name);
- mysql_function_query(dbhandle,query,true,"OnUserCheck","i",playerid);
- //Textdraw
- TextDrawShowForPlayer(playerid, uhrzeitLabel);
- //Lettore colore
- SetPlayerColor(playerid, COLOR_WHITE);
- return 1;
- }
- savePlayer(playerid)
- {
- if(sInfo[playerid][eingeloggt]==0)return 1;
- //Speichern level,money
- new query[256];
- format(query,sizeof(query),"UPDATE giocatore SET livello='%i',money='%i',alevel='%i',frazione='%i,rango='%i',cambiaspawn='%i' dove id='%i'",sInfo[playerid][level],
- GetPlayerMoney(playerid),sInfo[playerid][alevel],sInfo[playerid][fraktion],sInfo[playerid][rang],sInfo[playerid][spawnchange],sInfo,sInfo[playerid][db_id]);
- mysql_function_query(dbhandle,query,false,"","");
- return 1;
- }
- resetPlayer(playerid)
- {
- for(new i=0; i<sizeof(sInfo[]); i++)
- {
- sInfo[playerid][playerInfo:i]=0;
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- for(new i=0; i<sizeof(cInfo); i++)
- {
- if(cInfo[i][id_x]==0)continue;
- if(cInfo[i][besitzer]!=sInfo[playerid][db_id])continue;
- GetVehiclePos(cInfo[i][id_x],cInfo[i][c_x],cInfo[i][c_y],cInfo[i][c_z]);
- GetVehicleZAngle(cInfo[i][id_x],cInfo[i][c_r]);
- new query[256];
- format(query,sizeof(query),"UPDATE auto setta x='%f',y='%f',z='%f',r='%f' all' id='%i'",cInfo[i][c_x],cInfo[i][c_y],cInfo[i][c_z],cInfo[i][c_r],cInfo[i][db_id]);
- mysql_function_query(dbhandle,query,false,"","");
- DestroyVehicle(cInfo[i][id_x]);
- cInfo[i][id_x]=0;
- }
- savePlayer(playerid);
- resetPlayer(playerid);
- return 1;
- }
- isPlayerInFrakt(playerid, f_id){
- if(sInfo[playerid][fraktion]==f_id)return 1;
- return 0;
- }
- public OnPlayerSpawn(playerid)
- {
- if(sInfo[playerid][spawnchange]==0)
- {
- for(new i=0; i<sizeof(hInfo); i++)
- {
- if(!hInfo[i][h_id])continue;
- if(!strlen(hInfo[i][h_besitzer]))continue;
- if(strcmp(hInfo[i][h_besitzer], getPlayerName(playerid), true))continue;
- if(hInfo[i][ih_x] != 0.0)
- {
- //Spawnato in casa
- SetPlayerPos(playerid, hInfo[i][ih_x], hInfo[i][ih_y], hInfo[i][ih_z]);
- SetPlayerInterior(playerid, hInfo[i][h_interior]);
- SetPlayerVirtualWorld(playerid, i);
- }
- else
- {
- //Spawnato fuori casa
- SetPlayerPos(playerid, hInfo[i][h_x], hInfo[i][h_y], hInfo[i][h_z]);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- }
- }
- }
- if(!isPlayerInFrakt(playerid, 0)){
- if(sInfo[playerid][spawnchange]==1)
- {
- new fID;
- fID = sInfo[playerid][fraktion];
- SetPlayerPos(playerid, fInfo[fID][f_x],fInfo[fID][f_y],fInfo[fID][f_z]);
- SetPlayerFacingAngle(playerid, fInfo[fID][f_r]);
- SetPlayerInterior(playerid, fInfo[fID][f_inter]);
- SetPlayerVirtualWorld(playerid, fInfo[fID][f_world]);
- SetPlayerColor(playerid, fInfo[fID][f_color]);
- }
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- new string[128];
- format(string,sizeof(string), "%s sagt: %s",
- getPlayerName(playerid), text);
- new chat_color;
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(!IsPlayerConnected(i))continue;
- if(!IsPlayerInRangeOfPoint(i, CHAT_RADIUS, x, y, z))continue;
- new Float:distance = GetPlayerDistanceFromPoint(i, x, y, z);
- if(distance < CHAT_RADIUS / CHAT_FADES)
- {
- chat_color = COLOR_CHAT;
- }
- else if(distance < CHAT_RADIUS / CHAT_FADES * 2)
- {
- chat_color = COLOR_FADE1;
- }
- else if(distance < CHAT_RADIUS / CHAT_FADES * 3)
- {
- chat_color = COLOR_FADE2;
- }
- else if(distance < CHAT_RADIUS / CHAT_FADES * 4)
- {
- chat_color = COLOR_FADE3;
- }
- else if(distance <= CHAT_RADIUS / CHAT_FADES * 5)
- {
- chat_color = COLOR_FADE4;
- }
- SendClientMessage(i, chat_color, string);
- }
- return 0;
- }
- getPlayerSpeed(playerid)
- {
- new Float:x, Float:y, Float:z, Float:rtn;
- if(IsPlayerInAnyVehicle(playerid))
- {
- GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
- }
- else
- {
- GetPlayerVelocity(playerid, x, y, z);
- }
- //rtn = radice(x*x + y*y + z*z);
- rtn = floatsqroot(x*x + y*y + z*z);
- return floatround(rtn * 100 * 1.61);
- }
- public carSavedToDB(carid)
- {
- cInfo[carid][db_id]=cache_insert_id(dbhandle);
- return 1;
- }
- saveCarToDB(playerid,carid)
- {
- new query[128];
- format(query,sizeof(query),"Inserisci auto (proprietario,modello,x,y,z,r) valore ('%i','%i','%f','%f','%f','%f')",sInfo[playerid][db_id],cInfo[carid][model],cInfo[carid][c_x],cInfo[carid][c_y],cInfo[carid][c_z],cInfo[carid][c_r]);
- mysql_function_query(dbhandle,query,true,"carSavedToDB","i",carid);
- return 1;
- }
- createPlayerCar(playerid,modelid,Float:x,Float:y,Float:z,Float:r)
- {
- for(new i=0; i<sizeof(cInfo); i++)
- {
- if(cInfo[i][id_x]!=0)continue;
- cInfo[i][besitzer]=sInfo[playerid][db_id];
- cInfo[i][c_x]=x;
- cInfo[i][c_y]=y;
- cInfo[i][c_z]=z;
- cInfo[i][c_r]=r;
- cInfo[i][model]=modelid;
- cInfo[i][id_x] = CreateVehicle(modelid,x,y,z,r,-1,-1,-1);
- new string[128];
- format(string,sizeof(string),"Auto cInfo[%i] è stato creato.",i);
- SendClientMessageToAll(COLOR_RED,string);
- saveCarToDB(playerid,i);
- return 1;
- }
- return 1;
- }
- public unfreezePlayer(playerid)
- {
- TogglePlayerControllable(playerid,true);
- return 1;
- }
- getPlayerName(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- return name;
- }
- hatPlayerHaus(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- for(new i=0; i<sizeof(hInfo); i++)
- {
- if(!hInfo[i][h_id])continue;
- if(!strlen(hInfo[i][h_besitzer]))continue;
- if(!strcmp(name, hInfo[i][h_besitzer], true))return 1;
- }
- return 0;
- }
- saveHaus(id)
- {
- new query[128];
- format(query, sizeof(query), "UPDATE Casa privata='%s', h_prezzo='%i' dove id='%i'", hInfo[id][h_besitzer], hInfo[id][h_preis], hInfo[id][h_id]);
- mysql_function_query(dbhandle, query, false, "", "");
- return 1;
- }
- public OnHausCreated(id)
- {
- hInfo[id][h_id]=cache_insert_id();
- }
- //Comandi
- ocmd:settaprezzo(playerid, params[])
- {
- if(!isAdmin(playerid, 3))return
- SendClientMessage(playerid, COLOR_RED, "Hai un rank admin basso.");
- new tmp_preis;
- if(sscanf(params, "i", tmp_preis))return
- SendClientMessage(playerid, COLOR_RED, "INFO: /settaprezzo [prezzo]");
- for(new i=0; i<sizeof(hInfo); i++)
- {
- if(!hInfo[i][h_id])continue;
- if(!IsPlayerInRangeOfPoint(playerid, 5,
- hInfo[i][h_x], hInfo[i][h_y], hInfo[i][h_z]))continue;
- hInfo[i][h_preis] = tmp_preis;
- saveHaus(i);
- updateHaus(i);
- return 1;
- }
- return 1;
- }
- ocmd:toglicasa(playerid, params[])
- {
- if(!isAdmin(playerid, 3))return
- SendClientMessage(playerid, COLOR_RED, "Hai un rank admin basso.");
- for(new i=0; i<sizeof(hInfo); i++)
- {
- if(!hInfo[i][h_id])continue;
- if(!IsPlayerInRangeOfPoint(playerid, 5,
- hInfo[i][h_x], hInfo[i][h_y], hInfo[i][h_z]))continue;
- new query[128];
- format(query,sizeof(query),
- "Casa tolta all' id='%i'", hInfo[i][h_id]);
- mysql_function_query(dbhandle, query, false, "", "");
- hInfo[i][h_x]=0.0;
- hInfo[i][h_y]=0.0;
- hInfo[i][h_z]=0.0;
- hInfo[i][ih_x]=0.0;
- hInfo[i][ih_y]=0.0;
- hInfo[i][ih_z]=0.0;
- hInfo[i][h_id]=0;
- hInfo[i][h_preis]=0;
- hInfo[i][h_interior]=0;
- if(hInfo[i][h_pickup])
- {
- DestroyPickup(hInfo[i][h_pickup]);
- }
- if(hInfo[i][h_text])
- {
- Delete3DTextLabel(hInfo[i][h_text]);
- }
- return 1;
- }
- return 1;
- }
- ocmd:creacasa(playerid, params[])
- {
- if(!isAdmin(playerid, 3))return
- SendClientMessage(playerid, COLOR_RED, "Hai un rank admin basso.");
- new Float:xc, Float:yc, Float:zc;
- GetPlayerPos(playerid, xc, yc, zc);
- new id=getFreeHausID();
- hInfo[id][h_x]=xc;
- hInfo[id][h_y]=yc;
- hInfo[id][h_z]=zc;
- hInfo[id][ih_x]=0.0;
- hInfo[id][ih_y]=0.0;
- hInfo[id][ih_z]=0.0;
- hInfo[id][h_interior]=0;
- strmid(hInfo[id][h_besitzer], "", 0, MAX_PLAYER_NAME, MAX_PLAYER_NAME);
- hInfo[id][h_preis]=1;
- updateHaus(id);
- //Aggiungere soldi alla banca
- new query[256];
- format(query, sizeof(query),
- "Inserisci casa (h_x, h_y, h_z, ih_x, ih_y, ih_z, h_interior, h_prezzo) valore ('%f', '%f', '%f', '0.0', '0.0', '0.0', '0', '1')",
- xc, yc, zc);
- mysql_function_query(dbhandle, query, true, "OnHausCreated", "i", id);
- return 1;
- }
- ocmd:vendicasa(playerid, params[])
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- for(new i=0; i<sizeof(hInfo); i++)
- {
- if(!hInfo[i][h_id])continue;
- if(!IsPlayerInRangeOfPoint(playerid, 5,
- hInfo[i][h_x], hInfo[i][h_y], hInfo[i][h_z]))continue;
- if(!strlen(hInfo[i][h_besitzer]))continue;
- if(!strcmp(hInfo[i][h_besitzer], name, true))
- {
- hInfo[i][h_preis]=hInfo[i][h_preis]/2;
- GivePlayerMoney(playerid, hInfo[i][h_preis]);
- strmid(hInfo[i][h_besitzer], "", 0, MAX_PLAYER_NAME, MAX_PLAYER_NAME);
- updateHaus(i);
- saveHaus(i);
- return 1;
- }
- }
- return 1;
- }
- ocmd:compracasa(playerid, params[])
- {
- if(hatPlayerHaus(playerid))return
- SendClientMessage(playerid, COLOR_RED, "Hai già una casa.");
- for(new i=0; i<sizeof(hInfo); i++)
- {
- if(!hInfo[i][h_id])continue;
- if(!IsPlayerInRangeOfPoint(playerid, 5,
- hInfo[i][h_x], hInfo[i][h_y], hInfo[i][h_z]))continue;
- if(!strlen(hInfo[i][h_besitzer]))
- {
- if(GetPlayerMoney(playerid)<hInfo[i][h_preis])return
- SendClientMessage(playerid, COLOR_RED, "Non hai abbastanza soldi.");
- GivePlayerMoney(playerid, -hInfo[i][h_preis]);
- strmid(hInfo[i][h_besitzer], getPlayerName(playerid), 0, MAX_PLAYER_NAME, MAX_PLAYER_NAME);
- updateHaus(i);
- saveHaus(i);
- return 1;
- }
- return SendClientMessage(playerid, COLOR_RED,
- "La casa non è in vendita.");
- }
- return 1;
- }
- ocmd:f(playerid,params[])
- {
- if(isPlayerInFrakt(playerid, 0))return SendClientMessage(
- playerid, COLOR_RED, "Non sei in nessuna fazione.");
- new string[128];
- if(sscanf(params, "s[128]", string))return SendClientMessage(
- playerid, COLOR_RED, "INFO: /f [messaggio]");
- new fID = sInfo[playerid][fraktion];
- format(string,sizeof(string), "**(( %s: %s ))**", getPlayerName(playerid), string);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(!IsPlayerConnected(i))continue;
- if(!isPlayerInFrakt(i, fID))continue;
- SendClientMessage(i, COLOR_BLUE, string);
- }
- return 1;
- }
- ocmd:invita(playerid,params[])
- {
- if(isPlayerInFrakt(playerid, 0))return SendClientMessage(
- playerid, COLOR_RED, "Non sei in nessuna fazione.");
- if(sInfo[playerid][rang] < 6)return SendClientMessage(
- playerid, COLOR_RED, "Il tuo rango è troppo basso.");
- new pID, fID;
- fID = sInfo[playerid][fraktion];
- if(sscanf(params, "u", pID))return SendClientMessage(
- playerid, COLOR_RED, "INFO: /invita [playerid]");
- if(!isPlayerInFrakt(pID, 0))return SendClientMessage(
- playerid, COLOR_RED, "Il giocatore non è un civile.");
- new string[128];
- format(string,sizeof(string), "%s ti ha invitato alla %s fazione.",
- getPlayerName(playerid), fInfo[fID][f_name]);
- SendClientMessage(pID, COLOR_YELLOW, string);
- SendClientMessage(pID, COLOR_YELLOW,
- "Hai ricevuto un invito fai /accetta.");
- SetPVarInt(pID, "inv_fraktid", fID);
- SetPVarInt(pID, "inv_inviter", playerid);
- return 1;
- }
- ocmd:togliinvito(playerid,params[])
- {
- if(isPlayerInFrakt(playerid, 0))return SendClientMessage(
- playerid, COLOR_RED, "Non sei in nessuna fazione.");
- if(sInfo[playerid][rang] < 6)return SendClientMessage(
- playerid, COLOR_RED, "Il tuo rango è troppo basso.");
- new pID;
- if(sscanf(params, "u", pID))return SendClientMessage(
- playerid, COLOR_RED, "INFO: /togliinvito [playerid]");
- if(!isPlayerInFrakt(pID, sInfo[playerid][fraktion]))return SendClientMessage(
- playerid, COLOR_RED, "Il giocatore non è nella fazione.");
- sInfo[pID][fraktion] = 0;
- sInfo[pID][rang] = 0;
- new string[128];
- format(string,sizeof(string),"Sei stato cacciato %s dalla fazione.",
- getPlayerName(playerid));
- SendClientMessage(pID, COLOR_RED, string);
- format(string,sizeof(string),"Hai buttato %s fuori dalla fazione.",
- getPlayerName(pID));
- SendClientMessage(playerid, COLOR_YELLOW, string);
- return 1;
- }
- ocmd:accetta(playerid, params[])
- {
- new item[64];
- if(sscanf(params,"s[64]",item))return SendClientMessage(
- playerid, COLOR_RED, "INFO: /accetta [invito]");
- if(!strcmp(item, "invita", false))
- {
- if(GetPVarInt(playerid, "inv_fraktid") == 0)return SendClientMessage(
- playerid, COLOR_RED, "Sei stato invitato nella fazione.");
- new fID = GetPVarInt(playerid, "inv_fraktid");
- sInfo[playerid][fraktion] = fID;
- sInfo[playerid][rang] = 1;
- new string[128];
- format(string,sizeof(string), "Ti sei unito alla %s fazione.",
- fInfo[fID][f_name]);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string,sizeof(string), "%s sei entrato nella fazione.",
- getPlayerName(playerid));
- SendClientMessage(GetPVarInt(playerid, "inv_inviter"), COLOR_RED,
- string);
- SetPVarInt(playerid, "inv_fraktid", 0);
- return 1;
- }
- return 1;
- }
- ocmd:cambiaspawn(playerid, params[])
- {
- if(isPlayerInFrakt(playerid, 0))return SendClientMessage(
- playerid, COLOR_RED, "Non sei in nessuna fazione.");
- if(sInfo[playerid][spawnchange]==0)
- {
- sInfo[playerid][spawnchange]=1;
- }
- if(sInfo[playerid][spawnchange]==1)
- {
- sInfo[playerid][spawnchange]=0;
- }
- SendClientMessage(playerid,COLOR_YELLOW, "Spawn cambiato.");
- return 1;
- }
- ocmd:settaleader(playerid, params[])
- {
- if(!isAdmin(playerid, 3))return SendClientMessage(playerid,
- COLOR_RED, "Il tuo rank admin è troppo basso.");
- new pID, fID;
- if(sscanf(params,"ui",pID,fID))return SendClientMessage(playerid,
- COLOR_RED, "INFO: /settaleader [playerid] [livello]");
- if(fID >= sizeof(fInfo))return SendClientMessage(playerid,
- COLOR_RED, "Il giocatore non esiste.");
- sInfo[pID][fraktion] = fID;
- sInfo[pID][rang] = 6;
- new string[128];
- format(string,sizeof(string),
- "%s ha settato leader del %s gruppo",
- getPlayerName(playerid), fInfo[fID][f_name]);
- SendClientMessage(pID, COLOR_YELLOW, string);
- SendClientMessage(playerid, COLOR_RED, "Hai messo il giocatore leader.");
- return 1;
- }
- ocmd:luci(playerid,params[])
- {
- if(GetPlayerState(playerid)!=PLAYER_STATE_DRIVER)return
- SendClientMessage(playerid,COLOR_RED,"Non sei al posto di guida.");
- new vID=GetPlayerVehicleID(playerid),
- tmp_engine,
- tmp_lights,
- tmp_alarm,
- tmp_doors,
- tmp_bonnet,
- tmp_boot,
- tmp_objective;
- //Spegnere il motore
- GetVehicleParamsEx(vID, tmp_engine, tmp_lights, tmp_alarm, tmp_doors, tmp_bonnet, tmp_boot, tmp_objective);
- if(tmp_lights==1){
- tmp_lights = 0;
- }else{
- tmp_lights = 1;
- }
- SetVehicleParamsEx(vID, tmp_engine, tmp_lights, tmp_alarm, tmp_doors, tmp_bonnet, tmp_boot, tmp_objective);
- return 1;
- }
- ocmd:motore(playerid,params[])
- {
- if(GetPlayerState(playerid)!=PLAYER_STATE_DRIVER)return
- SendClientMessage(playerid,COLOR_RED,"Non sei al posto di guida.");
- new vID=GetPlayerVehicleID(playerid),
- tmp_engine,
- tmp_lights,
- tmp_alarm,
- tmp_doors,
- tmp_bonnet,
- tmp_boot,
- tmp_objective;
- //Spegnere il motore
- GetVehicleParamsEx(vID, tmp_engine, tmp_lights, tmp_alarm, tmp_doors, tmp_bonnet, tmp_boot, tmp_objective);
- if(tmp_engine==1){
- tmp_engine = 0;
- }else{
- tmp_engine = 1;
- }
- SetVehicleParamsEx(vID, tmp_engine, tmp_lights, tmp_alarm, tmp_doors, tmp_bonnet, tmp_boot, tmp_objective);
- return 1;
- }
- ocmd:freeza(playerid,params[])
- {
- TogglePlayerControllable(playerid,false);
- SetTimerEx("unfreezePlayer",3000,false,"i",playerid);
- return 1;
- }
- ocmd:goto(playerid,params[])
- {
- new ID;
- if(sscanf(params, "u", ID)) SendClientMessage(playerid, 0xFF0000FF, "Usa: /goto [playerid]");
- else if(!IsPlayerConnected(ID) || ID == playerid) return SendClientMessage(playerid, 0xFF0000FF, "Questo giocatore non è in game");
- else
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(ID, x, y, z);
- SetPlayerPos(playerid, x+1, y+1, z);
- }
- return 1;
- }
- ocmd:stoppatimer(playerid,params[])
- {
- KillTimer(sekunden_timer);
- return 1;
- }
- ocmd:eliminaveicolo(playerid,params[])
- {
- if(!isAdmin(playerid,2))return SendClientMessage(playerid,COLOR_RED,"Il tuo rank admin è basso.");
- if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,COLOR_RED,"Sei nella macchina.");
- DestroyVehicle(GetPlayerVehicleID(playerid));
- return 1;
- }
- ocmd:creaveicolo(playerid,params[])
- {
- if(!isAdmin(playerid,2))return SendClientMessage(playerid,COLOR_RED,"Il tuo rank admin è basso.");
- new mID,pID;
- if(sscanf(params,"ui",pID,mID))return SendClientMessage(playerid,COLOR_RED,"INFO: /creaveicolo [playerid] [modello]");
- if(mID<400||mID>611)return SendClientMessage(playerid,COLOR_RED,"Modello invalido.");
- new Float:xc,Float:yc,Float:zc,Float:rc;
- GetPlayerPos(pID,xc,yc,zc);
- GetPlayerFacingAngle(pID,rc);
- createPlayerCar(pID,mID,xc,yc,zc,rc);
- return 1;
- }
- ocmd:esci(playerid,params[])
- {
- for(new i=0; i<sizeof(bInfo); i++)
- {
- if(GetPlayerVirtualWorld(playerid)!=i)continue;
- if(!IsPlayerInRangeOfPoint(playerid,2,bInfo[i][b_ix],bInfo[i][b_iy],bInfo[i][b_iz]))continue;
- SetPlayerPos(playerid,bInfo[i][b_x],bInfo[i][b_y],bInfo[i][b_z]);
- SetPlayerInterior(playerid,0);
- SetPlayerVirtualWorld(playerid,0);
- return 1;
- }
- for(new i=0; i<sizeof(hInfo); i++)
- {
- if(GetPlayerVirtualWorld(playerid)!=i)continue;
- if(!IsPlayerInRangeOfPoint(playerid,2,hInfo[i][ih_x],hInfo[i][ih_y],hInfo[i][ih_z]))continue;
- SetPlayerPos(playerid, hInfo[i][h_x], hInfo[i][h_y], hInfo[i][h_z]);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- return 1;
- }
- return 1;
- }
- ocmd:entra(playerid,params[])
- {
- for(new i=0; i<sizeof(bInfo); i++)
- {
- if(!IsPlayerInRangeOfPoint(playerid,2,bInfo[i][b_x],bInfo[i][b_y],bInfo[i][b_z]))continue;
- SetPlayerPos(playerid,bInfo[i][b_ix],bInfo[i][b_iy],bInfo[i][b_iz]);
- SetPlayerInterior(playerid,bInfo[i][b_interior]);
- SetPlayerVirtualWorld(playerid,i);
- SetPlayerShopName(playerid,bInfo[i][b_shopname]);
- return 1;
- }
- for(new i=0; i<sizeof(hInfo); i++)
- {
- if(!hInfo[i][h_id])continue;
- if(hInfo[i][ih_x]==0.0)continue;
- if(!IsPlayerInRangeOfPoint(playerid,2,hInfo[i][h_x],hInfo[i][h_y],hInfo[i][h_z]))continue;
- SetPlayerPos(playerid,hInfo[i][ih_x],hInfo[i][ih_y],hInfo[i][ih_z]);
- SetPlayerInterior(playerid,hInfo[i][h_interior]);
- SetPlayerVirtualWorld(playerid,i);
- return 1;
- }
- return 1;
- }
- ocmd:pm(playerid,params[])
- {
- new pID,text[128];
- if(sscanf(params,"us[128]",pID,text))return SendClientMessage(playerid,COLOR_RED,"INFO: /pn [playerid] [testo]");
- SendClientMessage(pID,COLOR_RED,text);
- return 1;
- }
- ocmd:settadmin(playerid,params[])
- {
- if(!isAdmin(playerid,3))return SendClientMessage(playerid,COLOR_RED,"Sei un rank admin basso.");
- new pID,a_level;
- if(sscanf(params,"ui",pID,a_level))return SendClientMessage(playerid,COLOR_RED,"INFO: /settadmin [playerid] [livelloadmin]");
- sInfo[pID][alevel]=a_level;
- savePlayer(pID);
- SendClientMessage(pID,COLOR_RED,"Il tuo rank admin è stato cambiato.");
- SendClientMessage(playerid,COLOR_RED,"Ha cambiato il rank.");
- return 1;
- }
- isAdmin(playerid,a_level)
- {
- if(sInfo[playerid][alevel]>=a_level)return 1;
- return 0;
- }
- ocmd:restarta(playerid,params[])
- {
- if(!isAdmin(playerid,3))return SendClientMessage(playerid,COLOR_RED,"Sei un rank admin basso.");
- SendRconCommand("gmx");
- return 1;
- }
- ocmd:test(playerid,params[])
- {
- SendClientMessage(playerid,COLOR_RED,"Hai fatto il /test.");
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(newstate==PLAYER_STATE_DRIVER)
- {
- new vID=GetPlayerVehicleID(playerid);
- new vModel=GetVehicleModel(vID);
- for(new i=0; i<sizeof(autosOhneMotor); i++)
- {
- if(autosOhneMotor[i]!=vModel)continue;
- new tmp_engine,
- tmp_lights,
- tmp_alarm,
- tmp_doors,
- tmp_bonnet,
- tmp_boot,
- tmp_objective;
- //Spegnere motore
- GetVehicleParamsEx(vID, tmp_engine, tmp_lights, tmp_alarm, tmp_doors, tmp_bonnet, tmp_boot, tmp_objective);
- SetVehicleParamsEx(vID, 1, tmp_lights, tmp_alarm, tmp_doors, tmp_bonnet, tmp_boot, tmp_objective);
- }
- for(new i=0; i<sizeof(ahCars); i++)
- {
- if(ahCars[i][id_x]!=vID)continue;
- //Vendita
- SetPVarInt(playerid,"buyCarID",i);
- new string[256];
- format(string,sizeof(string),"Vuoi comprare l'auto %i$ per?",ahCars[i][c_preis]);
- ShowPlayerDialog(playerid,DIALOG_AUTOHAUS,DIALOG_STYLE_MSGBOX,"Vendita auto",string,"Si","No");
- break;
- }
- return 1;
- }
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys & KEY_YES)
- {
- //Inserisci comando
- ocmd_entra(playerid,"");
- return 1;
- }
- if(newkeys & KEY_NO)
- {
- //Comando exit
- ocmd_esci(playerid,"");
- return 1;
- }
- if(newkeys & KEY_ACTION)
- {
- if(!IsPlayerInAnyVehicle(playerid))return 1;
- if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 525)return 1;
- //Veicoli
- new vID = GetPlayerVehicleID(playerid);
- if(IsTrailerAttachedToVehicle(vID))
- {
- //Veicolo
- DetachTrailerFromVehicle(vID);
- }
- else
- {
- //Veicolo
- new carID = INVALID_VEHICLE_ID;
- new Float:abstand = 8;
- new Float:xc, Float:yc, Float:zc;
- GetVehiclePos(vID, xc, yc, zc);
- for(new i=0; i<MAX_VEHICLES; i++)
- {
- if(!IsVehicleStreamedIn(i, playerid))continue;
- if(i==vID)continue;
- if(GetVehicleDistanceFromPoint(i, xc, yc, zc) < abstand)
- {
- abstand = GetVehicleDistanceFromPoint(i, xc, yc, zc);
- carID = i;
- }
- }
- if(carID != INVALID_VEHICLE_ID)
- {
- AttachTrailerToVehicle(carID, vID);
- }
- }
- }
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- SetPlayerMoney(playerid,money)
- {
- ResetPlayerMoney(playerid);
- GivePlayerMoney(playerid,money);
- return 1;
- }
- getFreeHausID()
- {
- for(new i=0; i<sizeof(hInfo); i++)
- {
- if(hInfo[i][h_id]==0)return i;
- }
- return 0;
- }
- getFreeCarID()
- {
- for(new i=0; i<sizeof(cInfo); i++)
- {
- if(cInfo[i][id_x]==0)return i;
- }
- return 0;
- }
- public OnPlayerCarsLoad(playerid)
- {
- new num_fields,num_rows;
- cache_get_data(num_rows,num_fields,dbhandle);
- if(!num_rows)return 1;
- for(new i=0; i<num_rows; i++)
- {
- new id=getFreeCarID();
- cInfo[id][model]=cache_get_field_content_int(i,"modello",dbhandle);
- cInfo[id][besitzer]=cache_get_field_content_int(i,"proprietario",dbhandle);
- cInfo[id][c_x]=cache_get_field_content_float(i,"x",dbhandle);
- cInfo[id][c_y]=cache_get_field_content_float(i,"y",dbhandle);
- cInfo[id][c_z]=cache_get_field_content_float(i,"z",dbhandle);
- cInfo[id][c_r]=cache_get_field_content_float(i,"r",dbhandle);
- cInfo[id][db_id]=cache_get_field_content_int(i,"id",dbhandle);
- cInfo[id][id_x]=CreateVehicle(cInfo[id][model],cInfo[id][c_x],cInfo[id][c_y],cInfo[id][c_z],cInfo[id][c_r],-1,-1,-1);
- }
- return 1;
- }
- loadPlayerCars(playerid)
- {
- new query[128];
- format(query,sizeof(query),"Seleziona * dalle auto del proprietario='%i'",sInfo[playerid][db_id]);
- mysql_function_query(dbhandle,query,true,"OnPlayerCarsLoad","i",playerid);
- return 1;
- }
- public OnPasswordResponse(playerid)
- {
- new num_fields,num_rows;
- cache_get_data(num_rows,num_fields,dbhandle);
- if(num_rows==1)
- {
- //Password
- sInfo[playerid][eingeloggt] = 1;
- sInfo[playerid][level] = cache_get_field_content_int(0,"level",dbhandle);
- SetPlayerScore(playerid,sInfo[playerid][level]);
- sInfo[playerid][db_id] = cache_get_field_content_int(0,"id",dbhandle);
- SetPlayerMoney(playerid,cache_get_field_content_int(0,"money",dbhandle));
- sInfo[playerid][alevel] = cache_get_field_content_int(0,"alevel",dbhandle);
- sInfo[playerid][fraktion] = cache_get_field_content_int(0,"fraktion",dbhandle);
- sInfo[playerid][rang] = cache_get_field_content_int(0,"rang",dbhandle);
- sInfo[playerid][spawnchange] = cache_get_field_content_int(0,"spawnchange",dbhandle);
- loadPlayerCars(playerid);
- }
- else
- {
- //Password
- SendClientMessage(playerid,COLOR_RED,"La password inserita è errata.");
- ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Logga","Si prega di inserire una propria password:","Ok","Esci");
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid==DIALOG_AUTOHAUS)
- {
- if(response)
- {
- //Vendita auto
- new id=GetPVarInt(playerid,"buyCarID");
- if(GetPlayerMoney(playerid)<ahCars[id][c_preis])
- {
- SendClientMessage(playerid,COLOR_RED,"Non hai abbastanza soldi.");
- RemovePlayerFromVehicle(playerid);
- return 1;
- }
- GivePlayerMoney(playerid,-ahCars[id][c_preis]);
- createPlayerCar(playerid,ahCars[id][model],ahInfo[ahCars[id][ah_id]][s_x],ahInfo[ahCars[id][ah_id]][s_y],ahInfo[ahCars[id][ah_id]][s_z],ahInfo[ahCars[id][ah_id]][s_r]);
- SendClientMessage(playerid,COLOR_RED,"Complimenti, hai acquistato l'auto");
- RemovePlayerFromVehicle(playerid);
- }
- else
- {
- RemovePlayerFromVehicle(playerid);
- SendClientMessage(playerid,COLOR_RED,"Allora non fare...");
- }
- return 1;
- }
- if(dialogid==DIALOG_LOGIN)
- {
- if(response)
- {
- new name[MAX_PLAYER_NAME],query[128],passwort[35];
- GetPlayerName(playerid,name,sizeof(name));
- if(strlen(inputtext)>0)
- {
- mysql_escape_string(inputtext,passwort,dbhandle);
- format(query,sizeof(query),"Seleziona * il personaggio='%s' e password=MD5('%s')",name,passwort);
- mysql_function_query(dbhandle,query,true,"OnPasswordResponse","i",playerid);
- }
- else
- {
- //Vietato accesso
- SendClientMessage(playerid,COLOR_RED,"Si prega di inserire una propria password.");
- ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Logga","Si prega di inserire la password:","Ok","Esci");
- }
- }
- else
- {
- Kick(playerid);
- }
- return 1;
- }
- if(dialogid==DIALOG_REGISTER)
- {
- if(response)
- {
- new name[MAX_PLAYER_NAME],query[128],passwort[35];
- GetPlayerName(playerid,name,sizeof(name));
- if(strlen(inputtext)>3)
- {
- //Registrazione
- mysql_escape_string(inputtext,passwort,dbhandle);
- format(query,sizeof(query),"Inserire nome (username,password) valore ('%s',MD5('%s')) ",name,passwort);
- mysql_function_query(dbhandle,query,false,"","");
- }
- else
- {
- //Kleiner als 4 Zeichen
- SendClientMessage(playerid,COLOR_RED,"La password deve essere lunga almeno 4 caratteri.");
- ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Registrazione...","Inerisci la tua password:","Ok","Esci");
- }
- }
- else
- {
- Kick(playerid);
- }
- return 1;
- }
- if(dialogid==DIALOG_TELEPORT)
- {
- if(response)
- {
- if(listitem==0)
- {
- //Spawn
- SetPlayerPos(playerid,199.0846,-150.0331,1.5781);
- }
- if(listitem==1)
- {
- //Farm
- SetPlayerPos(playerid,0.0,0.0,6.0);
- }
- }
- else
- {
- SendClientMessage(playerid,COLOR_RED,"Operazione riuscita.");
- }
- return 1;
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment