Is anything wrong in this script
#1

I have a dealership script from california im trying to edit it to make it work without dialogs so i get many errors with this lines , anything wrong here?

Код:
	if(strcmp(cmd, "/carbuy", true) == 0)
	{
	    new veh = GetPlayerVehicleID(playerid);
		if(VehOwned[veh] == 0)
		{
			if(IsADealerCar[veh] == 1)
			{
                new file[256], name[MAX_PLAYER_NAME];
  	         	GetPlayerName(playerid, name, sizeof(name));
			    format(file,sizeof(file),"Cars/%s.ini",name);
                new veh = GetPlayerVehicleID(playerid);
		        new money = GetPlayerMoney(playerid);
	            if(money >= CarPrice[veh])
	            {
	                if(gPlayerHasCar[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "You already own a car.");
	                new string[64];
	                SendClientMessage(playerid, 0xAFAFAFAA, "Thank you for buying at Coutt and Schutz.");
	                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
			    	dini_Create(file);
				    Vehicle[playerid] = CreateVehicle(GetVehicleModel(veh), 2130.1914, -1109.5881, 25.1890, 76.2599, 1, 1, 3600000);
                    format(string, sizeof(string), "Creating your vehicle %i.", veh);
	                SendClientMessage(playerid, 0xAFAFAFAA, string);
		    		VehicleInfo[playerid][Model] = GetVehicleModel(veh);
			    	VehicleInfo[playerid][Price] = CarPrice[veh];
				    VehicleInfo[playerid][CarX] = 2130.1914;
			    	VehicleInfo[playerid][CarY] = -1109.5881;
			    	VehicleInfo[playerid][CarZ] = 25.1890;
			    	VehicleInfo[playerid][CarRot] = 76.2599;
			    	gPlayerHasCar[playerid] = 1;
			    	RemovePlayerFromVehicle(playerid);
			    	OwnerID[Vehicle[playerid]] = playerid;
			    	VehPlate[Vehicle[playerid]] = "XYZR 000";
			    	PutPlayerInVehicle(playerid, Vehicle[playerid], 0);
			    	GivePlayerMoney(playerid, -VehicleInfo[playerid][Price]);
		        }
			    else
			    {
			       RemovePlayerFromVehicle(playerid);
			       SendClientMessage(playerid, 0xAFAFAFAA, "You cannot afford this vehicle.");
			       return 1;
   			    }
   			}
	}
Reply
#2

BUMP! please help plz
Reply
#3

bump please help me out please
Reply
#4

What are the Error lines ?

Peace...
Reply
#5

Post the exact errors you get.
Reply
#6

This is the errors i get,
Код:
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(780) : error 004: function "LoadTrunk" is not implemented
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(822) : error 004: function "SaveTrunk" is not implemented
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1195) : error 004: function "RemovePlayerWeapon" is not implemented
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1209) : error 004: function "RemovePlayerWeapon" is not implemented
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1223) : error 004: function "RemovePlayerWeapon" is not implemented
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1237) : error 004: function "RemovePlayerWeapon" is not implemented
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1251) : error 004: function "RemovePlayerWeapon" is not implemented
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1265) : error 004: function "RemovePlayerWeapon" is not implemented
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1279) : error 004: function "RemovePlayerWeapon" is not implemented
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1293) : error 004: function "RemovePlayerWeapon" is not implemented
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1307) : error 004: function "RemovePlayerWeapon" is not implemented
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1321) : error 004: function "RemovePlayerWeapon" is not implemented
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1561) : warning 219: local variable "veh" shadows a variable at a preceding level
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1594) : warning 217: loose indentation
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1603) : error 017: undefined symbol "IsACar"
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1723) : warning 217: loose indentation
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1723) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1723) : error 004: function "OnPlayerEnterCheckpoint" is not implemented
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1734) : warning 225: unreachable code
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1734) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1734) : error 004: function "OnVehicleStreamIn" is not implemented
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1736) : error 017: undefined symbol "vehicleid"
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1738) : error 017: undefined symbol "vehicleid"
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1739) : error 017: undefined symbol "vehicleid"
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1743) : error 017: undefined symbol "vehicleid"
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1744) : error 017: undefined symbol "vehicleid"
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1749) : warning 225: unreachable code
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1749) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1749) : error 017: undefined symbol "IsACar"
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1751) : error 017: undefined symbol "vehicleid"
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1765) : warning 225: unreachable code
C:\Documents and Settings\Administrator\My Documents\Downloads\dealership.pwn(1765) : error 029: invalid expression, assumed zero

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


26 Errors.
Reply
#7

Youre missing a } somewhere.
Reply
#8

This is the entire edited script
http://pastebin.com/jKWP5VLm
Reply
#9

Can you find any thing wrong in the script, Thanks in advance
Reply
#10

pawn Код:
if(strcmp(cmd, "/carbuy", true) == 0)
    {
        new veh = GetPlayerVehicleID(playerid);
        if(VehOwned[veh] == 0)
        {
            if(IsADealerCar[veh] == 1)
            {
                new file[256], name[MAX_PLAYER_NAME];
                GetPlayerName(playerid, name, sizeof(name));
                format(file,sizeof(file),"Cars/%s.ini",name);
                new veh = GetPlayerVehicleID(playerid);
                new money = GetPlayerMoney(playerid);
                if(money >= CarPrice[veh])
                {
                    if(gPlayerHasCar[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "You already own a car.");
                    new string[64];
                    SendClientMessage(playerid, 0xAFAFAFAA, "Thank you for buying at Coutt and Schutz.");
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    dini_Create(file);
                    Vehicle[playerid] = CreateVehicle(GetVehicleModel(veh), 2130.1914, -1109.5881, 25.1890, 76.2599, 1, 1, 3600000);
                    format(string, sizeof(string), "Creating your vehicle %i.", veh);
                    SendClientMessage(playerid, 0xAFAFAFAA, string);
                    VehicleInfo[playerid][Model] = GetVehicleModel(veh);
                    VehicleInfo[playerid][Price] = CarPrice[veh];
                    VehicleInfo[playerid][CarX] = 2130.1914;
                    VehicleInfo[playerid][CarY] = -1109.5881;
                    VehicleInfo[playerid][CarZ] = 25.1890;
                    VehicleInfo[playerid][CarRot] = 76.2599;
                    gPlayerHasCar[playerid] = 1;
                    RemovePlayerFromVehicle(playerid);
                    OwnerID[Vehicle[playerid]] = playerid;
                    VehPlate[Vehicle[playerid]] = "XYZR 000";
                    PutPlayerInVehicle(playerid, Vehicle[playerid], 0);
                    GivePlayerMoney(playerid, -VehicleInfo[playerid][Price]);
                }
                else
                {
                   RemovePlayerFromVehicle(playerid);
                   SendClientMessage(playerid, 0xAFAFAFAA, "You cannot afford this vehicle.");
                   return 1;
                }
            }
        } // You was missing this bracket
    }
There was one bracket missing, try it now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)