Problem with a command
#1

So I have a RPG server, and I wanted to put a command to find my car. And I got some errors.

That's the command

Код:
CMD:findcar(playerid, params[])
{

    if(CP[playerid] >= 1 || CPR[playerid] >= 1 || playerVariables[playerid][pCheckpoint] >= 1)
    return SendClientMessage(playerid, COLOR_GREY, "Foloseste /killcp pentru a folosi comanda !");

    new carslot;
	if(sscanf(params, "d", carslot)) return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/findcar [1/2/3/4]");
	{
		if(playerVariables[playerid][pCarModel1] >= 1 || playerVariables[playerid][pCarModel2] >= 1 || playerVariables[playerid][pCarModel3] >= 1 || playerVariables[playerid][pCarModel4] >= 1)
		{
		    if(carslot == 1)
		    {
				GetVehiclePos(playerVariables[playerid][pCarID1], playerVariables[playerid][pCarPos1][0], playerVariables[playerid][pCarPos1][1], playerVariables[playerid][pCarPos1][2]);
				SetPlayerCheckpoint(playerid, playerVariables[playerid][pCarPos1][0], playerVariables[playerid][pCarPos1][1], playerVariables[playerid][pCarPos1][2], 10.0);
				playerVariables[playerid][pCheckpoint] = 4;

				format(szMessage, sizeof(szMessage), "A checkpoint has been set to your %s.", VehicleNames[playerVariables[playerid][pCarModel1] - 400]);
				SendClientMessage(playerid, COLOR_WHITE, szMessage);
			}
			else if(carslot == 2)
			{
			    GetVehiclePos(playerVariables[playerid][pCarID2], playerVariables[playerid][pCarPos2][0], playerVariables[playerid][pCarPos2][1], playerVariables[playerid][pCarPos2][2]);
				SetPlayerCheckpoint(playerid, playerVariables[playerid][pCarPos2][0], playerVariables[playerid][pCarPos2][1], playerVariables[playerid][pCarPos2][2], 10.0);
				playerVariables[playerid][pCheckpoint] = 4;

				format(szMessage, sizeof(szMessage), "A checkpoint has been set to your %s.", VehicleNames[playerVariables[playerid][pCarModel2] - 400]);
				SendClientMessage(playerid, COLOR_WHITE, szMessage);

			}
			else if(carslot == 3)
			{
			    GetVehiclePos(playerVariables[playerid][pCarID3], playerVariables[playerid][pCarPos3][0], playerVariables[playerid][pCarPos3][1], playerVariables[playerid][pCarPos3][2]);
				SetPlayerCheckpoint(playerid, playerVariables[playerid][pCarPos3][0], playerVariables[playerid][pCarPos3][1], playerVariables[playerid][pCarPos3][2], 10.0);
				playerVariables[playerid][pCheckpoint] = 4;

				format(szMessage, sizeof(szMessage), "A checkpoint has been set to your %s.", VehicleNames[playerVariables[playerid][pCarModel3] - 400]);
				SendClientMessage(playerid, COLOR_WHITE, szMessage);

			}
			else if(carslot == 4)
			{
			    GetVehiclePos(playerVariables[playerid][pCarID4], playerVariables[playerid][pCarPos4][0], playerVariables[playerid][pCarPos4][1], playerVariables[playerid][pCarPos4][2]);
				SetPlayerCheckpoint(playerid, playerVariables[playerid][pCarPos4][0], playerVariables[playerid][pCarPos4][1], playerVariables[playerid][pCarPos4][2], 10.0);
				playerVariables[playerid][pCheckpoint] = 4;

				format(szMessage, sizeof(szMessage), "A checkpoint has been set to your %s.", VehicleNames[playerVariables[playerid][pCarModel4] - 400]);
				SendClientMessage(playerid, COLOR_WHITE, szMessage);

			}
			else SendClientMessage(playerid, COLOR_GREY, "Invalid car slot id.");
		}
		else SendClientMessage(playerid, COLOR_GREY, "You don't own a vehicle.");
	}
	return 1;
}
And the errors: http://imgur.com/a/4mi0j

Help me please
Reply


Messages In This Thread
Problem with a command - by DarkElement - 08.08.2016, 17:16
Re: Problem with a command - by Mencent - 08.08.2016, 17:56
Re: Problem with a command - by AndySedeyn - 08.08.2016, 17:58
Re: Problem with a command - by Mencent - 08.08.2016, 18:00

Forum Jump:


Users browsing this thread: 1 Guest(s)