SA-MP Forums Archive
'SERVER: Unknown command' after used DestroyVehicle(); - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: 'SERVER: Unknown command' after used DestroyVehicle(); (/showthread.php?tid=66902)



'SERVER: Unknown command' after used DestroyVehicle(); - Faust - 25.02.2009

So I have this little function in my gamemode:
Code:
public OnPlayerDeath(playerid)
{
	DestroyVehicle(Veh[playerid]);
}
But after it's used/when player has died, none of commands work. When I type a command I get this error 'SERVER: Unknown command.'
Why it's that?


Re: 'SERVER: Unknown command' after used DestroyVehicle(); - Norn - 25.02.2009

Quote:
Originally Posted by Faust
So I have this little function in my gamemode:
Code:
public OnPlayerDeath(playerid)
{
	DestroyVehicle(Veh[playerid]);
}
But after it's used/when player has died, none of commands work. When I type a command I get this error 'SERVER: Unknown command.'
Why it's that?
pawn Code:
public OnPlayerDeath(playerid)
{
    DestroyVehicle(Veh[playerid]);
return 1;
}



Re: 'SERVER: Unknown command' after used DestroyVehicle(); - Faust - 25.02.2009

Already tried that and still commands don't work.


Re: 'SERVER: Unknown command' after used DestroyVehicle(); - Killerkid - 25.02.2009

OnPlayerDeath has 3 parameters, you would have known that if you read the warnings, they're there for a reason and you may need to return OnPlayerDeath.
Not sure if it is bad to destroy a vehicle that doesn't not exist but I couldn't find any function to check.
Try this:

pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    DestroyVehicle(Veh[playerid]);
    return 1;
}



Re: 'SERVER: Unknown command' after used DestroyVehicle(); - Faust - 25.02.2009

If there would be any warnings .. I had no errors.
Tried your version too, but again there isn't any changes.




Re: 'SERVER: Unknown command' after used DestroyVehicle(); - Coicatak - 25.02.2009

Where you put Veh[MAX_PLAYERS] ?


Re: 'SERVER: Unknown command' after used DestroyVehicle(); - Faust - 25.02.2009

On top of the script where is all define thingies.


Re: 'SERVER: Unknown command' after used DestroyVehicle(); - Coicatak - 25.02.2009

Quote:
Originally Posted by Faust
On top of the script where is all define thingies.
Show us where Veh is updated


Re: 'SERVER: Unknown command' after used DestroyVehicle(); - Faust - 25.02.2009

What do you mean by updated? You want to see where it is used?


Re: 'SERVER: Unknown command' after used DestroyVehicle(); - Faust - 25.02.2009

Anyway, look by yourselfs:
http://pawno.pastebin.com/d5f386270



Re: 'SERVER: Unknown command' after used DestroyVehicle(); - Joe Staff - 25.02.2009

pawn Код:
if(Veh[playerid])DestroyVehicle(Veh[playerid]);
try that


Re: 'SERVER: Unknown command' after used DestroyVehicle(); - boylett - 25.02.2009

Quote:
Originally Posted by Killerkid.
OnPlayerDeath has 3 parameters, you would have known that if you read the warnings, they're there for a reason and you may need to return OnPlayerDeath.
Not sure if it is bad to destroy a vehicle that doesn't not exist but I couldn't find any function to check.
Try this:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    DestroyVehicle(Veh[playerid]);
    return 1;
}
In PAWN, you can miss of parameters on public functions


Re: 'SERVER: Unknown command' after used DestroyVehicle(); - Faust - 25.02.2009

Nope, SilentHuntR, it didn't help. God dammit!