'SERVER: Unknown command' after used DestroyVehicle();
#1

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?
Reply
#2

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;
}
Reply
#3

Already tried that and still commands don't work.
Reply
#4

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;
}
Reply
#5

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

Reply
#6

Where you put Veh[MAX_PLAYERS] ?
Reply
#7

On top of the script where is all define thingies.
Reply
#8

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

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

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

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

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
Reply
#13

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


Forum Jump:


Users browsing this thread: 2 Guest(s)