What is wrong?
#1

This function is not work, what ir wrong?
Код:
stock GetSlotOfSpawnedVehicle( playerid )
{
	// Funkcija: GetSlotOfSpawnedVehicle( playerid )

	for ( new i = 0; i < MAX_OWNABLE_VEHICLES; i++ )
	    if ( VehInfo[ playerid ][ i ][ vSpawned ] )
	        return i;

	return MAX_OWNABLE_VEHICLES;
}
And is this not working for this command
Код:
else if ( !strcmp( result, "deletev", true ) )
	    {
	        new
	            slot = GetSlotOfSpawnedVehicle( playerid );
	            
			if ( slot < MAX_OWNABLE_VEHICLES )
			{
			    DropVehicleRow( VehInfo[ playerid ][ slot ][ vDBID ] );
			    ShowInfoText  ( playerid, "yuor vehicle is deleted", 4000 );
			    TogglePlayerControllable( playerid, true );
			}
			else
			    SendClientMessage( playerid, COLOR_GREY, "Tuo not spawn vehicle" );
	    }
Reply
#2

Please help
Reply
#3

Please help my
Reply
#4

Look at the brackets at the first script

stock GetSlotOfSpawnedVehicle( playerid )

it must be like this

stock GetSlotOfSpawnedVehicle(playerid)

do this in all of your brackets, where you putted an extra space, and what are the errors, that you are getting?
Reply
#5

stock GetSlotOfSpawnedVehicle(playerid)
{
// Funkcija: GetSlotOfSpawnedVehicle(playerid)

for (new i = 0; i < MAX_OWNABLE_VEHICLES; i++)
if (VehInfo[ playerid ][ i ][ vSpawned ])
return i;

return MAX_OWNABLE_VEHICLES;
}

Return i??!?!?!?!?!?!?!? I am not such a good scripter but i think it should be 1


else if (!strcmp( result, "deletev", true ))
{
new
slot = GetSlotOfSpawnedVehicle(playerid);

if (slot < MAX_OWNABLE_VEHICLES)
{
DropVehicleRow(VehInfo[playerid][slot][vDBID]);
ShowInfoText(playerid, "Your vehicle is deleted", 4000);
TogglePlayerControllable(playerid, true);
}

else
SendClientMessage(playerid, COLOR_GREY, "Tuo not spawn vehicle");
}
Reply
#6

Still does not work
Reply
#7

what are the errors that you are getting?
Reply
#8

Failure of ductile comands:
Lock/unlock
Код:
 else if ( !strcmp( result, "rakinti", true ) )
	    {
	        new
	            slot = CheckIfPlayerHasSpawnedVehicle(playerid);
	            
			if (slot < MAX_OWNABLE_VEHICLES)
			{
			    new
			        vehid = GetVehIdBySlot(playerid, slot);
			        
				if (vehid < MAX_VEHICLES)
				{
				    if (CheckPlayerDistanceToVehicle( 5.0, playerid, vehid ))
				    {
				        if (VehInfo[playerid][slot][vLock] < 1 )
				            return SendClientMessage( playerid, COLOR_GREY, "   Jūs neturite uћrakto.");
				    
				        if (SVehInfo[vehid][vLock] > 0)
				        { // Transporto priemonė yra uћrakinta
				            SVehInfo[vehid][vLock] = 0;
				            LockVehicleForPlayers(vehid, false);
				            ShowInfoText         (playerid, "~g~Transporto priemone atrakinta", 3000);
				        }
				        else
				        { // Transporto priemonė yra atrakinta
				            SVehInfo[vehid][vLock] = VehInfo[playerid][slot][vLock];
				            LockVehicleForPlayers(vehid, true);
				            ShowInfoText         ( playerid, "~r~Transporto priemone uzrakinta", 3000 );
				        }
				    }
				    else
						SendClientMessage( playerid, COLOR_GREY, "   Jūs neesate љalia savo transporto priemonės." );
				}
				else
				    SendClientMessage( playerid, COLOR_RED, "KLAIDA" );
			}
			else
			    SendClientMessage( playerid, COLOR_GREY, "   Jūs neturite iљsispawninę transporto priemonės." );
	    } else if ( !strcmp( result, "rakinti", true ) )
	    {
	        new
	            slot = CheckIfPlayerHasSpawnedVehicle(playerid);
	            
			if (slot < MAX_OWNABLE_VEHICLES)
			{
			    new
			        vehid = GetVehIdBySlot(playerid, slot);
			        
				if (vehid < MAX_VEHICLES)
				{
				    if (CheckPlayerDistanceToVehicle( 5.0, playerid, vehid ))
				    {
				        if (VehInfo[playerid][slot][vLock] < 1 )
				            return SendClientMessage( playerid, COLOR_GREY, "   Jūs neturite uћrakto.");
				    
				        if (SVehInfo[vehid][vLock] > 0)
				        { // Transporto priemonė yra uћrakinta
				            SVehInfo[vehid][vLock] = 0;
				            LockVehicleForPlayers(vehid, false);
				            ShowInfoText         (playerid, "~g~Transporto priemone atrakinta", 3000);
				        }
				        else
				        { // Transporto priemonė yra atrakinta
				            SVehInfo[vehid][vLock] = VehInfo[playerid][slot][vLock];
				            LockVehicleForPlayers(vehid, true);
				            ShowInfoText         ( playerid, "~r~Transporto priemone uzrakinta", 3000 );
				        }
				    }
				    else
						SendClientMessage( playerid, COLOR_GREY, "   Jūs neesate љalia savo transporto priemonės." );
				}
				else
				    SendClientMessage( playerid, COLOR_RED, "KLAIDA" );
			}
			else
			    SendClientMessage( playerid, COLOR_GREY, "   Jūs neturite iљsispawninę transporto priemonės." );
	    }
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)