What is wrong? -
gedas_lt - 06.07.2010
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" );
}
Re: What is wrong? -
gedas_lt - 06.07.2010
Please help
Re: What is wrong? -
gedas_lt - 07.07.2010
Please help my
Re: What is wrong? -
yoan103 - 07.07.2010
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?
Re: What is wrong? -
yoan103 - 07.07.2010
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");
}
Re: What is wrong? -
gedas_lt - 07.07.2010
Still does not work
Re: What is wrong? -
yoan103 - 07.07.2010
what are the errors that you are getting?
Re: What is wrong? -
gedas_lt - 07.07.2010
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." );
}