Jump to content

Question

Posted

Am si eu nevoie de ajutor. Primesc urmatoarele erori:C:\Users\Gabi\Desktop\Server with gamemode\gamemodes\gmpower.pwn(38704) : error 001: expected token: ",", but found "["
C:\Users\Gabi\Desktop\Server with gamemode\gamemodes\gmpower.pwn(38704) : error 029: invalid expression, assumed zero
C:\Users\Gabi\Desktop\Server with gamemode\gamemodes\gmpower.pwn(38704) : warning 215: expression has no effect
C:\Users\Gabi\Desktop\Server with gamemode\gamemodes\gmpower.pwn(38704) : error 001: expected token: ";", but found "]"
C:\Users\Gabi\Desktop\Server with gamemode\gamemodes\gmpower.pwn(38704) : fatal error 107: too many error messages on one line

 

La comanda asa:

CMD:instalator(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(IsPlayerConnected(playerid))
    {
        if(PlayerInfo[playerid][pJob] == 16)
        {
            new Veh = GetPlayerVehicleID(playerid);
            if(Veh == instac[1] || Veh == instac[2] || Veh == instac[3] || Veh == instac[4] || Veh == instac[5] || Veh == instac[6] || Veh == instac[7] || Veh == instac[8] || Veh == instac[9] || Veh == instac[10] || Veh == instac[11] || Veh == instac[12] && PlayerInfo[playerid][pJob] == 16)
            {
                if(GetPlayerState(playerid) == 2)
                {
                    DisablePlayerRaceCheckpoint(playerid);
                    new rand,Float:Position[3];
                    rand = random(sizeof(gRandomInsta));
                    GetPlayerPos(playerid, Position[0], Position[1], Position[2]);
                    SetPlayerCheckpoint(playerid,gRandomInsta[rand][0],gRandomInsta[rand][1],gRandomInsta[rand][2], 4.0);
                    floatround(GetDistanceBetweenPoints(Position[0],Position[1], Position[2], gRandomInsta[rand][0], gRandomInsta[rand][1], gRandomInsta[rand][2]), floatround_round);
                    InstaCP[playerid] = 1;
                    SCM(playerid,COLOR_GREY,"Mergi la checkpointul de pe mapa pentru a repara teava casei.");
                }
                else return SCM(playerid,COLOR_WHITE,"You are not the driver of instalator car.");
            }
            else return SCM(playerid,COLOR_WHITE,"You are not in a instalator car.");
        }
        else return SCM(playerid,COLOR_WHITE,"You are not a Instalator.");
    }
    return 1;
}

19 answers to this question

Recommended Posts

  • 0
Posted
12 minutes ago, gabygabyt said:

Il vreau intr-o anumita locatie. 

 

EDIT: dupa ce am pus gRandomInsta[rand][0] primesc erorile astea: 

C:\Users\Gabi\Desktop\Server with gamemode\gamemodes\gmpower.pwn(1187) : error 017: undefined symbol "rand"
C:\Users\Gabi\Desktop\Server with gamemode\gamemodes\gmpower.pwn(38702) : warning 224: indeterminate array size in "sizeof" expression (symbol "")


C:\Users\Gabi\Desktop\Server with gamemode\gamemodes\gmpower.pwn(1187) : error 017: undefined symbol "rand"
C:\Users\Gabi\Desktop\Server with gamemode\gamemodes\gmpower.pwn(38702) : warning 224: indeterminate array size in "sizeof" expression (symbol "")

 

Corect este:

New gRandInsta[3][//câte locații să fie] =

{

"X,Y,Z",

"X,Y,Z"

};

Sper să nu fi greșit ceva, sunt pe telefon.

 

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

  • 0
Posted (edited)
CMD:instalator(playerid, params[])
{
	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(IsPlayerConnected(playerid))
    {
		if(PlayerInfo[playerid][pJob] == 16)
		{
			new Veh = GetPlayerVehicleID(playerid);
			if(Veh == instac[1] || Veh == instac[2] || Veh == instac[3] || Veh == instac[4] || Veh == instac[5] || Veh == instac[6] || Veh == instac[7] || Veh == instac[8] || Veh == instac[9] || Veh == instac[10] || Veh == instac[11] || Veh == instac[12] && PlayerInfo[playerid][pJob] == 16)
			{
				if(GetPlayerState(playerid) == 2)
			    {
			        DisablePlayerRaceCheckpoint(playerid);
		            new rand,Float:Position[3];
					rand = random(sizeof(gRandomInsta));
					GetPlayerPos(playerid, Position[0], Position[1], Position[2]);
					SetPlayerCheckpoint(playerid,gRandomInsta[rand][0],gRandomInsta[rand][1],gRandomInsta[rand][2], 4.0);
					floatround(GetDistanceBetweenPoints(Position[0],Position[1], Position[2], gRandomInsta[rand][0], gRandomInsta[rand][1], gRandomInsta[rand][2]), floatround_round);
					InstaCP[playerid] = 1;
					SCM(playerid,COLOR_GREY,"Mergi la checkpointul de pe mapa pentru a repara teava casei.");
			    }
			    else return SCM(playerid,COLOR_WHITE,"You are not the driver of instalator car.");
			}
			else return SCM(playerid,COLOR_WHITE,"You are not in a instalator car.");
		}
		else return SCM(playerid,COLOR_WHITE,"You are not a Instalator.");
	}
	return 1;
}

Nu stiu care sunt liniile ce imi dau eroare. Asta e problema

Edited by gabygabyt
  • 0
Posted

@gabygabyt Apasă CTRL + G și du-te la linia 38704 și pune în post acea linie, până atunci o să trec prin întregul cod, dar să fiu sigur că modific linia corectă.

Gh38gEQ.gif

  • 0
Posted
SetPlayerCheckpoint(playerid,gRandomInsta[rand][0],gRandomInsta[rand][1],gRandomInsta[rand][2], 4.0);

asta e linia

  • 0
Posted
Just now, gabygabyt said:

SetPlayerCheckpoint(playerid,gRandomInsta[rand][0],gRandomInsta[rand][1],gRandomInsta[rand][2], 4.0);

asta e linia

Arată linia de deasupra si de dedesubt liniei asta.

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

  • 0
Posted
GetPlayerPos(playerid, Position[0], Position[1], Position[2]);
					SetPlayerCheckpoint(playerid,gRandomInsta[rand][0],gRandomInsta[rand][1],gRandomInsta[rand][2], 4.0);
					floatround(GetDistanceBetweenPoints(Position[0],Position[1], Position[2], gRandomInsta[rand][0], gRandomInsta[rand][1], gRandomInsta[rand][2]), floatround_round);

 

  • 0
Posted
5 minutes ago, gabygabyt said:

SetPlayerCheckpoint(playerid,gRandomInsta[rand][0],gRandomInsta[rand][1],gRandomInsta[rand][2], 4.0);

asta e linia

 

2 minutes ago, ImpulsE said:

Deja ai codul postat mai sus.

Sa știi și tu ca la erorile de genul, greșeală se poate afla si deasupra sau dedesubt.

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

  • 0
Posted
Just now, DaEdRiC-FoX said:

 

Sa știi și tu ca la erorile de genul, greșeală se poate afla si deasupra sau dedesubt.

Mă refeream la faptul că ai toată comanda postată mai sus, dar în fine, eu zic să terminăm off-topic-ul.

Gh38gEQ.gif

  • 0
Posted
9 minutes ago, gabygabyt said:

Stie cineva?

Arată-mi cum ai gRandomInsta definit, deoarece mai mult ca sigur problema cu invalid expression este de la faptul că nu folosești bine gRandomInsta.

Gh38gEQ.gif

  • 0
Posted (edited)
5 minutes ago, gabygabyt said:

gRandomInsta[MAX_PLAYERS],

 

GRandomInsta l.ai folosit ca o matrice în comanda, deci e definit aiurea.

 

Iar dacă l.ai Definit new gRandomInsta[MAX_PLAYERS] pui ; nu doar ,

Edited by DaEdRiC-FoX

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

  • 0
Posted

Păi dacă ai gRandomInsta[MAX_PLAYERS] cum vrei să setezi checkpoint așa?: Explică-mi cum vrei să setezi acel checkpoint, adică îl vrei la un jucător sau ai gRandomInsta definit greșit pentru că tu îl vrei într-o anumită locație?

gRandomInsta[rand][0]

Gh38gEQ.gif

  • 0
Posted (edited)

Il vreau intr-o anumita locatie. 

 

EDIT: dupa ce am pus gRandomInsta[rand][0] primesc erorile astea: 

C:\Users\Gabi\Desktop\Server with gamemode\gamemodes\gmpower.pwn(1187) : error 017: undefined symbol "rand"
C:\Users\Gabi\Desktop\Server with gamemode\gamemodes\gmpower.pwn(38702) : warning 224: indeterminate array size in "sizeof" expression (symbol "")

C:\Users\Gabi\Desktop\Server with gamemode\gamemodes\gmpower.pwn(1187) : error 017: undefined symbol "rand"
C:\Users\Gabi\Desktop\Server with gamemode\gamemodes\gmpower.pwn(38702) : warning 224: indeterminate array size in "sizeof" expression (symbol "")

 

Edited by gabygabyt
  • 0
Posted
Acum 11 minute, DaEdRiC-FoX a spus:

Corect este:

New gRandInsta[3][//câte locații să fie] =

{

"X,Y,Z",

"X,Y,Z"

};

Sper să nu fi greșit ceva, sunt pe telefon.

 

Revin cu un reply dupa ce incerc.

Acum 2 minute, gabygabyt a spus:

Revin cu un reply dupa ce incerc.

Multumesc mult. Acum merge.

Rezolvat. Cer T/C.

  • 0
Posted
31 minutes ago, gabygabyt said:

Il vreau intr-o anumita locatie. 

 

EDIT: dupa ce am pus gRandomInsta[rand][0] primesc erorile astea: 

C:\Users\Gabi\Desktop\Server with gamemode\gamemodes\gmpower.pwn(1187) : error 017: undefined symbol "rand"
C:\Users\Gabi\Desktop\Server with gamemode\gamemodes\gmpower.pwn(38702) : warning 224: indeterminate array size in "sizeof" expression (symbol "")


C:\Users\Gabi\Desktop\Server with gamemode\gamemodes\gmpower.pwn(1187) : error 017: undefined symbol "rand"
C:\Users\Gabi\Desktop\Server with gamemode\gamemodes\gmpower.pwn(38702) : warning 224: indeterminate array size in "sizeof" expression (symbol "")

 

Pentru puțin.

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Guest
This topic is now closed to further replies.
×
×
  • 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.