Jump to content

Řidičák s Checkpointy


Vidie

Recommended Posts

v newu asi máš new ridicak[MAX_PLAYERS]; a tam v tom riadku mas Ridicak... a k tomu current ak to plati k menu tak si ho musis taky definovat

 

new Menu:Current = GetPlayerMenu(playerid);

 

to daj normál do OnPlayerSelectedMenuRow a pod to už jen

 

if(Current == TVOJEMENU) {....

 

nic zloziteho

Link to comment
Share on other sites

  • Replies 73
  • Created
  • Last Reply

Top Posters In This Topic

v newu asi máš new ridicak[MAX_PLAYERS]; a tam v tom riadku mas Ridicak... a k tomu current ak to plati k menu tak si ho musis taky definovat

 

new Menu:Current = GetPlayerMenu(playerid);

 

to daj normál do OnPlayerSelectedMenuRow a pod to už jen

 

if(Current == TVOJEMENU) {....

 

nic zloziteho

 

Aůe když toto udělám tak mi pak po F5 Odesilat Neodesilat a kdyz dam neodesilat tak uztam ty errory nejsou ale AMX má 0 bajtu proč ? "suspect"

:shock:

Link to comment
Share on other sites

v newu asi máš new ridicak[MAX_PLAYERS]; a tam v tom riadku mas Ridicak... a k tomu current ak to plati k menu tak si ho musis taky definovat

 

new Menu:Current = GetPlayerMenu(playerid);

 

to daj normál do OnPlayerSelectedMenuRow a pod to už jen

 

if(Current == TVOJEMENU) {....

 

nic zloziteho

 

Aůe když toto udělám tak mi pak po F5 Odesilat Neodesilat a kdyz dam neodesilat tak uztam ty errory nejsou ale AMX má 0 bajtu proč ? "suspect"

:shock:

 

Mas moc uzavreny public neboli hodne zavorek xD

Link to comment
Share on other sites

- Když zpustíte test, vytvořívám to auto a hodí vás ho do něj ;)

 

to je o ničom v realu taky neřekneš čus chci si udelat autoškolu a nehodi tě to do auta...

Link to comment
Share on other sites

  • 3 weeks later...

hh dost dobre ale pise mi to errory....

C:\Users\Denis\Desktop\ridicak.pwn(207) : error 017: undefined symbol "Current"
C:\Users\Denis\Desktop\ridicak.pwn(214) : error 017: undefined symbol "Ridicak"
C:\Users\Denis\Desktop\ridicak.pwn(214) : warning 215: expression has no effect
C:\Users\Denis\Desktop\ridicak.pwn(214) : error 001: expected token: ";", but found "]"
C:\Users\Denis\Desktop\ridicak.pwn(214) : error 029: invalid expression, assumed zero
C:\Users\Denis\Desktop\ridicak.pwn(214) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.

 

 

tu je pwn kod...

 

#include

#include

#include

#pragma tabsize 0

 

#define COLOR_BLUE 0x0000FFAA

#define COLOR_RED 0xAA3333AA

#define COLOR_WHITE 0xFFFFFFAA

 

#define Check1 1

#define Check2 2

#define Check3 3

#define Check4 4

#define Check5 5

#define Check6 6

#define Check7 7

#define Check8 8

#define Check9 9

#define Check10 10

#define Check11 11

#define Check12 12

#define Check13 13

#define Check14 14

#define Check15 15

#define Check16 16

#define Check17 17

#define Check18 18

#define Check19 19

#define Check20 20

 

new ridicak[MAX_PLAYERS];

new pickup;

new Menu:tvemenu;

new autoskola[MAX_PLAYERS];

new autoskolacar;

 

public OnGameModeInit()

{

AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);

pickup = CreatePickup(1239,1,-2025.8839111328, -99.101287841797, 34.358531951904);//Zadej ID A souradnice kde se objevi pickup a s jakou ikonou (nej je 1581)

tvemenu = CreateMenu("Vodicak", 1, 150.0, 100.0, 250.0, 150.0);//

AddMenuItem(tvemenu, 0, "Urobit vodicsky"); //Dejte sem co chcete treba koupit ridicak,udelat ridicak...

AddMenuItem(tvemenu, 0, "Koniec"); //tady dejte to co mu to menu skryje.

return 1;

}

 

public OnPlayerRequestClass(playerid, classid)

{

SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);

SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);

SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);

return 1;

}

 

public OnPlayerConnect(playerid)

{

ridicak[playerid] = dUserINT(PlayerName(playerid)).("ridicak");//da ridičák pod loginu

return 1;

}

 

public OnPlayerDisconnect(playerid, reason)

{

dUserSetINT(PlayerName(playerid)).("ridicak",ridicak[playerid]);//Uloží řidičák

return 1;

}

 

 

public OnPlayerEnterCheckpoint(playerid)

{

switch(autoskola[playerid]) {

case Check1:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2043.9080,-73.0937,35.1719,7.0);

autoskola[playerid] = Check1;

}

case Check2:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2100.7759,-71.4886,35.1719,7.0);

autoskola[playerid] = Check2;

}

case Check3:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2166.7324,-76.7342,35.1797,7.0);

autoskola[playerid] = Check3;

}

case Check4:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2182.5525,-186.5366,35.1797,7.0);

autoskola[playerid] = Check4;

}

case Check5:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2260.0105,-183.7933,35.1719,7.0);

autoskola[playerid] = Check5;

}

case Check6:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2254.3542,-64.8176,35.1719,7.0);

autoskola[playerid] = Check6;

}

case Check7:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2253.6948,-11.5600,35.1719,7.0);

autoskola[playerid] = Check7;

}

case Check8:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2270.6436,51.0326,35.1641,7.0);

autoskola[playerid] = Check8;

}

case Check9:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2372.4958,-59.8218,35.1719,7.0);

autoskola[playerid] = Check9;

}

case Check10:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2444.1387,-70.5005,34.2163,7.0);

autoskola[playerid] = Check10;

}

case Check11:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2502.6421,-44.9208,25.5722,7.0);

autoskola[playerid] = Check11;

}

case Check12:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2493.1738,39.4464,25.4688,7.0);

autoskola[playerid] = Check12;

}

case Check13:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2421.2566,80.9228,35.0234,7.0);

autoskola[playerid] = Check13;

}

case Check14:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2415.9214,263.9146,35.0156,7.0);

autoskola[playerid] = Check14;

}

case Check15:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2308.3813,414.3891,35.0156,7.0);

autoskola[playerid] = Check15;

}

case Check16:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2235.8386,318.1005,35.1719,7.0);

autoskola[playerid] = Check16;

}

case Check17:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2014.2693,321.0696,35.0156,7.0);

autoskola[playerid] = Check17;

}

case Check18:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2010.2810,100.3372,27.5391,7.0);

autoskola[playerid] = Check18;

}

case Check19:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2033.3792,-73.3741,35.1719,7.0);

autoskola[playerid] = Check19;

}

case Check20:

{

DisablePlayerCheckpoint(playerid);

ridicak[playerid] = 1;//da mu ridicak

DestroyVehicle(autoskolacar);

SendClientMessage(playerid,COLOR_WHITE,"[ ! ] Urobil si si vodičák!"); // posle zprávu že Dostal ridicak

}

}

return 1;

}

 

public OnPlayerPickUpPickup(playerid, pickupid)

{

if(pickupid == pickup)

{

ShowMenuForPlayer(tvemenu,playerid);//Ukáže menu

}

return 1;

}

 

public OnPlayerSelectedMenuRow(playerid, row)

{

207 if (Current == tvemenu ) {

switch(row) {

case 0:{

if(GetPlayerMoney(playerid) < 1999) {// nemá peníze

SendClientMessage(playerid, COLOR_RED, "[ ! ] Nemáš peniaze [ 2000,- ].");//posle zprávu že nemá prachy

}

else

214 if (Ridicak[playerid] == 1)

{

SendClientMessage(playerid, COLOR_WHITE, "[ ! ] Už máš vodičák!");//posle zprávu že již má řidičák

}else{//když tyto podmínky splnuje

GivePlayerMoney(playerid,-2000);

SendClientMessage(playerid,COLOR_BLUE,"[ ! ] Prechadzaj cez checkpointy!");//posle zprávu že dělá test

SetPlayerCheckpoint(playerid,Pozice X,Y,Z,7.0);//Nastaví checkpoint

autoskolacar = CreateVehicle(ID Auta, X, Y, Z, Facing, random(100), random(100), 1000); // Vytvorí auto

PutPlayerInVehicle(playerid, autoskolacar,0);

autoskola[playerid] = Check2;//a když do něj vejde, přejde na další

}

}

}

}

return 1;

}

 

stock PlayerName(playerid)

{

new name[255];

GetPlayerName(playerid, name, 255);

return name;

}

return 1;

}

 

Link to comment
Share on other sites

  • 2 months later...

Omlouvám se, že je to starý téma, ale jdu na pickup, dám mezerník na Udelat test anic se nestane.. :( zadna zprava nic.. hledal jsem chybu, ale nikde sem nenasel, tak nevim.. nevite proc to nejde? errory zadny "confused" "confused"

Link to comment
Share on other sites

Omlouvám se, že je to starý téma, ale jdu na pickup, dám mezerník na Udelat test anic se nestane.. :( zadna zprava nic.. hledal jsem chybu, ale nikde sem nenasel, tak nevim.. nevite proc to nejde? errory zadny "confused" "confused"

 

Nevíme, ale toto je trochu náročnější tut... skus si ho projít znovu ;)

Link to comment
Share on other sites

  • 7 months later...

mam s tim trosku problem :

(741) : error 001: expected token: ")", but found "("

(741) : error 010: invalid function or declaration

(741 -- 742) : error 010: invalid function or declaration

(741 -- 742) : fatal error 107: too many error messages on one line

 

a riadky 741-742 :

  dUserSetINT(PlayerName(playerid)).("ridicak",ridicak[playerid]);//RIADOK 741
  return 1; // RIADOK 742
  }

 

pls help

Link to comment
Share on other sites

Zdravím mám jeden error pls poraďte

 

error 017: undefined symbol "Current"

 

a když ho nadefinuji jako #define new Menu:Current

 

..tak mi to napíše další 4 errory neví pls někdo co s tím??

Link to comment
Share on other sites

ulpne super jde mi to ale potrebuji s tim steje pomoct :(

 

1 tam ridicak ma ale ja chci udelat este 1 ridicak (letecak) ale kdyz tam pridam nove checkpointy tak mi to haze error

 

 

//toto je vporadku az do case: 11

 

public OnPlayerEnterCheckpoint(playerid)

switch(autoskola[playerid]) {

case Check2:

{

DisablePlayerCheckpoint(playerid);//vypne predesli

SetPlayerCheckpoint(playerid,-2096.6794,-70.3599,34.7381,7.0);//sem zase novej checkpoint

autoskola[playerid] = Check3;//Přepne na dalsi checkpoint

//a zase dookola ;)

}

case Check3:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2096.6794,-70.3599,34.7381,7.0);

autoskola[playerid] = Check4;

}

case Check4:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2259.7625,-70.0886,34.7385,7.0);

autoskola[playerid] = Check5;

}

case Check5:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2371.1848,-26.6866,34.7300,7.0);

autoskola[playerid] = Check6;

}

case Check6:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2294.2913,50.1108,34.7304,7.0);

autoskola[playerid] = Check7;

}

case Check7:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2251.2844,182.3883,34.7380,7.0);

autoskola[playerid] = Check8;

}

case Check8:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2189.2869,208.4539,34.7377,7.0);

autoskola[playerid] = Check9;

}

case Check9:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2149.0818,153.4512,34.7373,7.0);

autoskola[playerid] = Check10;

}

case Check10:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,-2076.4180,-71.3968,34.7380,7.0);

autoskola[playerid] = Check11;

}

case Check11:

{

DisablePlayerCheckpoint(playerid);

ridicak[playerid] = 1;//da mu ridicak

DestroyVehicle(autoskolacar);

SendClientMessage(playerid,COLOR_WHITE,"[ ! ] Udělal sis řidičák!"); // posle zprávu že Dostal ridicak

}

}

//_________________________________________________________________________________

//s timto potrebuji pomoct

 

 

switch(letskola[playerid]) { //radek 2302:

case Check12: //radek 2303:

{

DisablePlayerCheckpoint(playerid);//vypne predesli

SetPlayerCheckpoint(playerid,95.5403,2736.3721,95.8340,7.0);//sem zase novej checkpoint

letskola[playerid] = Check13;//Přepne na dalsi checkpoint

//a zase dookola ;)

} //radek 2309

case Check13: //radek 2310

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,4.9821,2597.7651,129.9523,7.0);

letskola[playerid] = Check14;

}

case Check14: //radek 2316:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,39.0177,2259.4824,133.4336,7.0);

letskola[playerid] = Check15;

}

case Check15: //radek 2322:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,235.5499,2186.9680,118.5702,7.0);

letskola[playerid] = Check16;

}

case Check16: //radek 2328:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,480.1938,2454.4666,53.9357,7.0);

letskola[playerid] = Check17;

}

case Check17: //radek 2334:

{

DisablePlayerCheckpoint(playerid);

SetPlayerCheckpoint(playerid,307.7008,2505.6274,16.4844,7.0);

letskola[playerid] = Check18;

}

case Check18: //radek 2340:

{

DisablePlayerCheckpoint(playerid);

letecak[playerid] = 1;//da mu ridicak

DestroyVehicle(letskolacar);

SendClientMessage(playerid,COLOR_WHITE,"[ ! ] Udělal jsi Letecak!"); // posle zprávu že Dostal ridicak

}

}

 

 

co stim ??

 

errory

 

C:\Users\Jiří\Desktop\samp03bsvr_R2_win32\pwn\C3RN3J.pwn(2302) : error 010: invalid function or declaration

C:\Users\Jiří\Desktop\samp03bsvr_R2_win32\pwn\C3RN3J.pwn(2303) : error 010: invalid function or declaration

C:\Users\Jiří\Desktop\samp03bsvr_R2_win32\pwn\C3RN3J.pwn(2309) : error 054: unmatched closing brace ("}")

C:\Users\Jiří\Desktop\samp03bsvr_R2_win32\pwn\C3RN3J.pwn(2310) : error 010: invalid function or declaration

C:\Users\Jiří\Desktop\samp03bsvr_R2_win32\pwn\C3RN3J.pwn(2316) : error 010: invalid function or declaration

C:\Users\Jiří\Desktop\samp03bsvr_R2_win32\pwn\C3RN3J.pwn(2322) : error 010: invalid function or declaration

C:\Users\Jiří\Desktop\samp03bsvr_R2_win32\pwn\C3RN3J.pwn(2328) : error 010: invalid function or declaration

C:\Users\Jiří\Desktop\samp03bsvr_R2_win32\pwn\C3RN3J.pwn(2334) : error 010: invalid function or declaration

C:\Users\Jiří\Desktop\samp03bsvr_R2_win32\pwn\C3RN3J.pwn(2340) : error 010: invalid function or declaration

C:\Users\Jiří\Desktop\samp03bsvr_R2_win32\pwn\C3RN3J.pwn(2557) : warning 202: number of arguments does not match definition

C:\Users\Jiří\Desktop\samp03bsvr_R2_win32\pwn\C3RN3J.pwn(2574) : warning 202: number of arguments does not match definition

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

 

 

9 Errors.

 

 

 


//zkousel jsem to opravit 

case Check11:
{
DisablePlayerCheckpoint(playerid);
ridicak[playerid] = 1;//da mu ridicak
DestroyVehicle(autoskolacar);
SendClientMessage(playerid,COLOR_WHITE,"[ ! ] Udělal sis řidičák!"); // posle zprávu že Dostal ridicak
letskola[playerid] = Check12; ////////udelal jsem to takhle 0 error ale kdyz vjedu na checkpoint tak to nic neudela takze delete 
}
case Check12:
{
DisablePlayerCheckpoint(playerid);//vypne predesli
SetPlayerCheckpoint(playerid,266.5542,2738.8428,60.3904,7.0);//sem zase novej checkpoint
letskola[playerid] = Check13;//Přepne na dalsi checkpoint
//a zase dookola 
}
case Check13:
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,4.9821,2597.7651,129.9523,7.0);
letskola[playerid] = Check14;
}
case Check14:
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,39.0177,2259.4824,133.4336,7.0);
letskola[playerid] = Check15;
}
case Check15:
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,235.5499,2186.9680,118.5702,7.0);
letskola[playerid] = Check16;
}
case Check16:
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,480.1938,2454.4666,53.9357,7.0);
letskola[playerid] = Check17;
}
case Check17:
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,307.7008,2505.6274,16.4844,7.0);
letskola[playerid] = Check18;
}
case Check18:
{
DisablePlayerCheckpoint(playerid);
letpruk[playerid] = 1;//da mu ridicak
DestroyVehicle(letskolacar);
SendClientMessage(playerid,COLOR_WHITE,"[ ! ] Udělal jsi Letecak!"); // posle zprávu že Dostal ridicak
}
}

Link to comment
Share on other sites

mam s timto zase problem prerobil som si tento vodicak na FS a mam fakt blbe chyby :

 

(42) : error 017: undefined symbol "tvemenu"

(43) : error 017: undefined symbol "tvemenu"

(44) : error 017: undefined symbol "tvemenu"

(46) : error 017: undefined symbol "pickup"

(123) : error 017: undefined symbol "autoskola"

(123) : error 029: invalid expression, assumed zero

(123) : error 029: invalid expression, assumed zero

(123) : fatal error 107: too many error messages on one line

 

a pritom medzi newami mam

new ridicak[MAX_PLAYERS];
new pickup;
new Menu:tvemenu;
new autoskola[MAX_PLAYERS];
new autoskolacar;

 

a riadok 123 :

switch(autoskola[playerid]){

 

prosim o skoru odpoved ..

Link to comment
Share on other sites

mam s timto zase problem prerobil som si tento vodicak na FS a mam fakt blbe chyby :

 

(42) : error 017: undefined symbol "tvemenu"

(43) : error 017: undefined symbol "tvemenu"

(44) : error 017: undefined symbol "tvemenu"

(46) : error 017: undefined symbol "pickup"

(123) : error 017: undefined symbol "autoskola"

(123) : error 029: invalid expression, assumed zero

(123) : error 029: invalid expression, assumed zero

(123) : fatal error 107: too many error messages on one line

 

a pritom medzi newami mam

new ridicak[MAX_PLAYERS];
new pickup;
new Menu:tvemenu;
new autoskola[MAX_PLAYERS];
new autoskolacar;

 

a riadok 123 :

switch(autoskola[playerid]){

 

prosim o skoru odpoved ..

 

 

Najdi si řádek #IF DEFINED FILTERSCRIPT (nebo tak nejak) ... pokud to máš ža pod tím... tak to je chyba... dej to nad to... ty new

Link to comment
Share on other sites

Když dam F5 pro vytvoření .amx tak se oběví "Program pawn přestal pracovat" a uložené .amx má 0 kb...Nevíte proč? (Mam Windows 7)

Něco blbě v modu

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...