Command error
#1

hello im trying to fix the /aselldealership command but getting errors all the time i need help with that.

Error's:
Код:
C:\Users\MetHenk\Desktop\DCRP\DCRP\gamemodes\DCRP.pwn(60578) : error 029: invalid expression, assumed zero
C:\Users\MetHenk\Desktop\DCRP\DCRP\gamemodes\DCRP.pwn(60578) : warning 215: expression has no effect
C:\Users\MetHenk\Desktop\DCRP\DCRP\gamemodes\DCRP.pwn(60578) : error 001: expected token: ";", but found "]"
C:\Users\MetHenk\Desktop\DCRP\DCRP\gamemodes\DCRP.pwn(60578) : error 029: invalid expression, assumed zero
C:\Users\MetHenk\Desktop\DCRP\DCRP\gamemodes\DCRP.pwn(60578) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Command:
Код:
CMD:aselldealership(playerid, params[])
{
	if (PlayerInfo[playerid][pAdmin] >= 5)
	{
		new playername[MAX_PLAYER_NAME];
		GetPlayerName(playerid, playername, sizeof(playername));

		new string[128], dealershipid;
		if(sscanf(params, "d", dealershipid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /aselldealership [Dealership ID]");

		new ip[32];
//		new CarDealershipInfo;
		GetPlayerIp(playerid,ip,sizeof(ip));
		format(string,sizeof(string),"Admin %s (IP: %s) has admin-sold Dealership ID %d (was owned by %s).",GetPlayerNameEx(playerid),ip,dealershipid,[dealershipid][cdOwner]);
		Log("logs/cardealership.log", string);
		format( CarDealerShipInfo[dealershipid][cdOwner], 128, "Nobody" );
		PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
		format(string, sizeof(string), "~w~You have sold dealership %d.", dealershipid);
		GameTextForPlayer(playerid, string, 10000, 3);
		DestroyPickupEx(CarDealerShipInfo[dealershipid][cdPickupID]);
		CarDealershipInfo[d][cdPickupID] = CreatePickupEx(1239, 1, CarDealershipInfo[d][cdEntranceX], CarDealershipInfo[d][cdEntranceY], CarDealershipInfo[d][cdEntranceZ]);
		DestroyDynamic3DTextLabel(CarDealerShipInfo[dealershipid][cdTextLabel]);
		format(text_info, sizeof(text_info),"Car Dealership %s For Sale\nPrice: %d\nRadius: %.1f\nID: %d", CarDealershipInfo[d][cdMessage], CarDealershipInfo[d][cdPrice], CarDealershipInfo[d][cdRadius], d);
	    CarDealershipInfo[d][cdTextLabel] = CreateDynamic3DTextLabel(text_info,COLOR_RED,CarDealershipInfo[d][cdEntranceX], CarDealershipInfo[d][cdEntranceY], CarDealershipInfo[d][cdEntranceZ]+0.75,3.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,1);
		return 1;
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use that command.");
	}
	return 1;
}
Thanks in advance.
Reply
#2

What is line 60578?
Reply
#3

Quote:
Originally Posted by Schneider
Посмотреть сообщение
What is line 60578?
Код:
format(string,sizeof(string),"Admin %s (IP: %s) has admin-sold Dealership ID %d (was owned by %s).",GetPlayerNameEx(playerid),ip,dealershipid,[dealershipid][cdOwner]);
Reply
#4

Код:
format(string,sizeof(string),"Admin %s (IP: %s) has admin-sold Dealership ID %d (was owned by %d).",GetPlayerNameEx(playerid),ip,dealershipid,enumed Dealership[dealershipid][cdOwner]);
Reply
#5

I guess it should be this at the end.
pawn Код:
dealershipid[cdOwner]
Reply
#6

Quote:
Originally Posted by Ironboy
Посмотреть сообщение
I guess it should be this at the end.
pawn Код:
dealershipid[cdOwner]
It should be something like:
Business[dealershipid][cdOwner]
Where Business have cdOwner enumed....;
Reply
#7

Quote:
Originally Posted by TFreemen
Посмотреть сообщение
Код:
format(string,sizeof(string),"Admin %s (IP: %s) has admin-sold Dealership ID %d (was owned by %d).",GetPlayerNameEx(playerid),ip,dealershipid,enumed Dealership[dealershipid][cdOwner]);
If i do what you said i get this errors


Код:
C:\Users\MetHenk\Desktop\DCRP\DCRP\gamemodes\DCRP.pwn(5892) : error 017: undefined symbol "SendClientMessageEX"
C:\Users\MetHenk\Desktop\DCRP\DCRP\gamemodes\DCRP.pwn(60584) : error 017: undefined symbol "enumed"
C:\Users\MetHenk\Desktop\DCRP\DCRP\gamemodes\DCRP.pwn(60584) : error 017: undefined symbol "Dealership"
C:\Users\MetHenk\Desktop\DCRP\DCRP\gamemodes\DCRP.pwn(60584) : warning 215: expression has no effect
C:\Users\MetHenk\Desktop\DCRP\DCRP\gamemodes\DCRP.pwn(60584) : error 001: expected token: ";", but found "]"
C:\Users\MetHenk\Desktop\DCRP\DCRP\gamemodes\DCRP.pwn(60584) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#8

Quote:
Originally Posted by TFreemen
Посмотреть сообщение
It should be something like:
Business[dealershipid][cdOwner]
Where Business have cdOwner enumed....;
I dont have the business system yet.
Reply
#9

See here CarDealerShipInfo

Код:
enum cdInfo
{
	cdOwned,
	cdOwner[MAX_PLAYER_NAME],
	Float: cdEntranceX,
	Float: cdEntranceY,
	Float: cdEntranceZ,
	Float: cdExitX,
	Float: cdExitY,
	Float: cdExitZ,
	cdMessage[128],
	cdTill,
	cdInterior,
	Float: cdRadius,
	cdPrice,
	cdPickupID,
	Text3D:cdTextLabel,
	Text3D:cdVehicleLabel[MAX_DEALERSHIPVEHICLES],
	cdVehicleModel[MAX_DEALERSHIPVEHICLES],
	cdVehicleCost[MAX_DEALERSHIPVEHICLES],
	cdVehicleId[MAX_DEALERSHIPVEHICLES],
	Float: cdVehicleSpawnX[MAX_DEALERSHIPVEHICLES],
	Float: cdVehicleSpawnY[MAX_DEALERSHIPVEHICLES],
	Float: cdVehicleSpawnZ[MAX_DEALERSHIPVEHICLES],
	Float: cdVehicleSpawnAngle[MAX_DEALERSHIPVEHICLES],
	Float: cdVehicleSpawn[4],
};
new CarDealershipInfo[MAX_CARDEALERSHIPS][cdInfo];
Reply
#10

Quote:
Originally Posted by hwakinsRP
Посмотреть сообщение
See here CarDealerShipInfo

Код:
enum cdInfo
{
	cdOwned,
	cdOwner[MAX_PLAYER_NAME],
	Float: cdEntranceX,
	Float: cdEntranceY,
	Float: cdEntranceZ,
	Float: cdExitX,
	Float: cdExitY,
	Float: cdExitZ,
	cdMessage[128],
	cdTill,
	cdInterior,
	Float: cdRadius,
	cdPrice,
	cdPickupID,
	Text3D:cdTextLabel,
	Text3D:cdVehicleLabel[MAX_DEALERSHIPVEHICLES],
	cdVehicleModel[MAX_DEALERSHIPVEHICLES],
	cdVehicleCost[MAX_DEALERSHIPVEHICLES],
	cdVehicleId[MAX_DEALERSHIPVEHICLES],
	Float: cdVehicleSpawnX[MAX_DEALERSHIPVEHICLES],
	Float: cdVehicleSpawnY[MAX_DEALERSHIPVEHICLES],
	Float: cdVehicleSpawnZ[MAX_DEALERSHIPVEHICLES],
	Float: cdVehicleSpawnAngle[MAX_DEALERSHIPVEHICLES],
	Float: cdVehicleSpawn[4],
};
new CarDealershipInfo[MAX_CARDEALERSHIPS][cdInfo];
HERE HERE:

Код:
format(string,sizeof(string),"Admin %s (IP: %s) has admin-sold Dealership ID %d (was owned by %d).",GetPlayerName(playerid),ip,dealershipid,CarDealershipInfo[dealershipid][cdOwner]);
TRY NOW
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)