SA-MP Forums Archive
Problems with Car destruction Infos. - 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: Problems with Car destruction Infos. (/showthread.php?tid=133069)



Problems with Car destruction Infos. - pmk1 - 10.03.2010

Hey guys! I'm posting there because i have a problem with my Car Destruction information. It is supposed to tell on the main chat:
'someone''s 'vehiclename' has been destroyed By 'someone' But, it says:
0 's 0 Has Been Destroyed By 255. I wonder What's wrong :\ I got no warnings for it on my script file.

Here are the lines:
//-------------------------------------------------------------------------
public OnVehicleDeath(vehicleid, killerid)
{
new string[40];
new playerid;
if(killerid == INVALID_PLAYER_ID) format(string, sizeof(string), " %d 's %d was destroyed.",playerid, GetPlayerVehicleName (playerid));
else format(string, sizeof(string), " %d 's %d Was Destroyed By %d", playerid, GetPlayerVehicleName(playerid), killerid);
SendClientMessageToAll(COLOR_BRIGHTRED, string);
return 1;
}

//---------------------------------------------------------------------------



What's wrong so the player's names and vehicles names don't show up?


Thanks :P

I attached a screen of my problem.


Re: Problems with Car destruction Infos. - adsy - 10.03.2010

sounds like you showing id's and not names

is there any GetPlayerName?

Do you have a GetVehicleModelID?


Re: Problems with Car destruction Infos. - pmk1 - 10.03.2010

W8, im modifing this.
I wried bad GetPlayerName, that was its problem But the GetplayerVehicleID is still same error.

Look:
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\gamemodes\pmkfunserver.pwn(1077) : error 017: undefined symbol "GetVehicleModelID"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Errors.

Hmm. How do i have to define GetVehicleID on this case?
Thanks!

Oh and here's the new script:
//-------------------------------------------------------------------------
public OnVehicleDeath(vehicleid, killerid)
{
new string[40];
new playerid;
GetPlayerName (playerid);
GetVehicleModelID (vehicleid);
if(killerid == INVALID_PLAYER_ID) format(string, sizeof(string), " %d 's %d was destroyed.",playerid, vehicleid);
else format(string, sizeof(string), " %d 's %d Was Destroyed By %d", playerid, vehicleid, killerid);
SendClientMessageToAll(COLOR_BRIGHTRED, string);
return 1;
}

//---------------------------------------------------------------------------


Re: Problems with Car destruction Infos. - adsy - 10.03.2010

wiki:

https://sampwiki.blast.hk/wiki/GetPlayerName
https://sampwiki.blast.hk/wiki/GetVehicleModel


Re: Problems with Car destruction Infos. - pmk1 - 10.03.2010

ok ill take a look. Thanks!


Re: Problems with Car destruction Infos. - pmk1 - 10.03.2010

hmm. Didn't help that much. The get player vehicle model won't work for my script, would be too many lines! and the GetPlayerVehicleID is to get vehicle's id, but im asking for the vehicle's name... Can you help me? thanks!


Re: Problems with Car destruction Infos. - Lejo - 10.03.2010

new KillerName[24], PlayerName[24];

GetPlayerName(playerid, PlayerName, 24);
GetPlayerName(killerid, KillerName, 24);

Now after doing that you can use KillerName, and PlayerName to show the name of the player that is in the vehicle and destroys it.


Re: Problems with Car destruction Infos. - pmk1 - 11.03.2010

Nah it's just not working. i'll forget that, it's too complicated. i get the same bug as before.
If you'd like to send me the script of it do it, because i'm not able to do it myself :\ thanks anyway