13.04.2009, 22:04
Hi guys.
1.- Sorry my bad English.
2.- How i can add Nitro in this buildmenu ?
My gamemode is Adrenaline 1.06.
I can add nitro option in the menu ( buildmode menu ),
Now i want to add a code to do work this option.
This is the menu:
This is the RaceType variable.
You see:
if (gRaceType==1)checktype=0; // standar checkpoint
if (gRaceType==2)checktype=1; // ring checkpoint
if (gRaceType==3)AddVehicleComponent(1010); // add NITRO ??
How i can do a race with nitro ??.
1.- Sorry my bad English.
2.- How i can add Nitro in this buildmenu ?
My gamemode is Adrenaline 1.06.
I can add nitro option in the menu ( buildmode menu ),
Now i want to add a code to do work this option.
This is the menu:
Код:
public OnPlayerSelectedMenuRow(playerid, row) { new Menu:Current = GetPlayerMenu(playerid); if (Current == voteMenu) { new vmsg[256],pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, MAX_PLAYER_NAME); format(vmsg,256,"* %s a votado por %s",pname,gVoteItems[row]); SendClientMessageToAll(COLOR_VIOLET,vmsg); gVotes[row]++; TogglePlayerControllable(playerid,1); return 1; } else if (Current == buildMenu[xRaceBuilding[playerid]-1]) { print("Doing something in buildmenu"); switch (xRaceBuilding[playerid]) { case 1: { switch (row) { case 0: xWorldTime[playerid] = 0; case 1: xWorldTime[playerid] = 3; case 2: xWorldTime[playerid] = 6; case 3: xWorldTime[playerid] = 9; case 4: xWorldTime[playerid] = 12; case 5: xWorldTime[playerid] = 15; case 6: xWorldTime[playerid] = 18; case 7: xWorldTime[playerid] = 21; } } case 2: { switch (row) { case 0: xWeatherID[playerid] = 0; case 1: xWeatherID[playerid] = 10; case 2: xWeatherID[playerid] = 12; case 3: xWeatherID[playerid] = 16; case 4: xWeatherID[playerid] = 16; case 5: xWeatherID[playerid] = 19; } } case 3: { switch (row) { case 0: xTrackTime[playerid] = 60; case 1: xTrackTime[playerid] = 120; case 2: xTrackTime[playerid] = 180; case 3: xTrackTime[playerid] = 240; case 4: xTrackTime[playerid] = 300; case 5: xTrackTime[playerid] = 360; case 6: xTrackTime[playerid] = 480; case 7: xTrackTime[playerid] = 600; case 8: xTrackTime[playerid] = 900; } } case 4: { switch (row) { case 0: xRaceType[playerid] = 1; case 1: xRaceType[playerid] = 2; case 2: xRaceType[playerid] = 3; // NITRO, this is my modification. } } case 5: { switch (row) { case 0: xCarIds[playerid][0] = 451; case 1: xCarIds[playerid][0] = 565; case 2: xCarIds[playerid][0] = 429; case 3: xCarIds[playerid][0] = 415; case 4: xCarIds[playerid][0] = 558; case 5: xCarIds[playerid][0] = 522; case 6: xCarIds[playerid][0] = 411; case 7: xCarIds[playerid][0] = 513; case 8: xCarIds[playerid][0] = 562; case 9: xCarIds[playerid][0] = 0, print("More1.."); } if (xCarIds[playerid][0] > 0) { SetPlayerVirtualWorld(playerid, playerid+100); printf("playerVirtual: %d world:%d",playerid, playerid+100); newCar(playerid); } } case 6: { switch (row) { case 0: xCarIds[playerid][0] = 560; case 1: xCarIds[playerid][0] = 506; case 2: xCarIds[playerid][0] = 402; case 3: xCarIds[playerid][0] = 424; case 4: xCarIds[playerid][0] = 477; case 5: xCarIds[playerid][0] = 541; case 6: xCarIds[playerid][0] = 494; case 7: xCarIds[playerid][0] = 559; case 8: xCarIds[playerid][0] = 495; case 9: xCarIds[playerid][0] = 0, print("More.."); } if (xCarIds[playerid][0] > 0) { SetPlayerVirtualWorld(playerid, playerid+100); printf("playerVirtual: %d world:%d",playerid, playerid+100); newCar(playerid); } } }
Код:
createBuildMenus() { buildMenu[0] = CreateMenu("World Time",1, 200.0, 125.0, 220.0, 50.0); SetMenuColumnHeader(buildMenu[0], 0, "Select The Time (Tiempo)"); AddMenuItem(buildMenu[0],0,"0:00"); AddMenuItem(buildMenu[0],0,"3:00"); AddMenuItem(buildMenu[0],0,"6:00"); AddMenuItem(buildMenu[0],0,"9:00"); AddMenuItem(buildMenu[0],0,"12:00"); AddMenuItem(buildMenu[0],0,"15:00"); AddMenuItem(buildMenu[0],0,"18:00"); AddMenuItem(buildMenu[0],0,"21:00"); buildMenu[1] = CreateMenu("Weather",1, 200.0, 125.0, 220.0, 50.0); SetMenuColumnHeader(buildMenu[1], 0, "Select the Weather (Clima)"); AddMenuItem(buildMenu[1],0,"Normal"); AddMenuItem(buildMenu[1],0,"Sunny"); AddMenuItem(buildMenu[1],0,"Grey"); AddMenuItem(buildMenu[1],0,"Rainy"); AddMenuItem(buildMenu[1],0,"Storm"); AddMenuItem(buildMenu[1],0,"Foggy"); buildMenu[2] = CreateMenu("TrackTime",1, 200.0, 125.0, 220.0, 50.0); SetMenuColumnHeader(buildMenu[2], 0, "Select the Track Time (Duracion)"); AddMenuItem(buildMenu[2],0,"1 minute"); AddMenuItem(buildMenu[2],0,"2 minutes"); AddMenuItem(buildMenu[2],0,"3 minutes"); AddMenuItem(buildMenu[2],0,"4 minutes"); AddMenuItem(buildMenu[2],0,"5 minutes"); AddMenuItem(buildMenu[2],0,"6 minutes"); AddMenuItem(buildMenu[2],0,"8 minutes"); AddMenuItem(buildMenu[2],0,"10 minutes"); AddMenuItem(buildMenu[2],0,"15 minutes"); buildMenu[3] = CreateMenu("RaceType",1, 200.0, 125.0, 220.0, 50.0); SetMenuColumnHeader(buildMenu[3], 0, "Select the type of race"); AddMenuItem(buildMenu[3],0,"Normal"); AddMenuItem(buildMenu[3],0,"Flying"); AddMenuItem(buildMenu[3],0,"Nitro"); // NITRO this is my modification. buildMenu[4] = CreateMenu("Vehicle",1, 200.0, 125.0, 220.0, 50.0); SetMenuColumnHeader(buildMenu[4], 0, "Select the Vehicle"); AddMenuItem(buildMenu[4],0,"Turismo"); AddMenuItem(buildMenu[4],0,"Flash"); AddMenuItem(buildMenu[4],0,"Banshee"); AddMenuItem(buildMenu[4],0,"Cheetah"); AddMenuItem(buildMenu[4],0,"Uranus"); AddMenuItem(buildMenu[4],0,"NRG 500"); AddMenuItem(buildMenu[4],0,"Infernus"); AddMenuItem(buildMenu[4],0,"Stunt Plane"); AddMenuItem(buildMenu[4],0,"Elegy"); AddMenuItem(buildMenu[4],0,"More..."); buildMenu[5] = CreateMenu("Vehicle2",1, 200.0, 125.0, 220.0, 50.0); SetMenuColumnHeader(buildMenu[5], 0, "Select the Vehicle"); AddMenuItem(buildMenu[5],0,"Sultan"); AddMenuItem(buildMenu[5],0,"SuperGT"); AddMenuItem(buildMenu[5],0,"Buffalo"); AddMenuItem(buildMenu[5],0,"BF Injection"); AddMenuItem(buildMenu[5],0,"ZR 350"); AddMenuItem(buildMenu[5],0,"Bullet"); AddMenuItem(buildMenu[5],0,"Hotring"); AddMenuItem(buildMenu[5],0,"Jester"); AddMenuItem(buildMenu[5],0,"Sand King");//495 AddMenuItem(buildMenu[5],0,"More...");//back }
Код:
SetCheckpoint(playerid, progress, totalchecks) { new checktype; if(gRaceType==1)checktype=0; else if(gRaceType==2) checktype=4; // else if(gRaceType==3) checktype=4 if (progress==totalchecks-1)SetPlayerRaceCheckpoint(playerid,1,RaceCheckpoints[progress][0],RaceCheckpoints[progress][1],RaceCheckpoints[progress][2],RaceCheckpoints[progress][0],RaceCheckpoints[progress][1],RaceCheckpoints[progress][2],CHECK_SIZE); else SetPlayerRaceCheckpoint(playerid,checktype,RaceCheckpoints[progress][0],RaceCheckpoints[progress][1],RaceCheckpoints[progress][2],RaceCheckpoints[progress+1][0],RaceCheckpoints[progress+1][1],RaceCheckpoints[progress+1][2],CHECK_SIZE); }
if (gRaceType==1)checktype=0; // standar checkpoint
if (gRaceType==2)checktype=1; // ring checkpoint
if (gRaceType==3)AddVehicleComponent(1010); // add NITRO ??
How i can do a race with nitro ??.