05.09.2012, 13:10
How to change the object Skull after Death of a player and change it to Coffin? Also give $500 cash whoever picks the coffin.
EDIT: Also it is possible to make coffin rotating so people may noticed that there was dead on that area
and Then after 30seconds if no one picks the coffin object then destroy automatically.
EDIT: Also it is possible to make coffin rotating so people may noticed that there was dead on that area

pawn Код:
#include <a_samp>
#define USE_OBJECT // Remove this if you don't want the script to create objects.
new tombstonePickups[MAX_PLAYERS];
#if defined USE_OBJECT
new tombstoneObjects[MAX_PLAYERS];
#endif
public OnFilterScriptInit()
{
print("\n#################\n Tombstones V2\n#################\n By Tr1viUm\n#################\n");
for(new i = 0; i < MAX_PLAYERS; i++){
tombstonePickups[i] = -1;
#if defined USE_OBJECT
tombstoneObjects[i] = -1;
#endif
}
return 1;
}
public OnFilterScriptExit()
{
for(new i = 0; i < MAX_PLAYERS; i++){
if(tombstonePickups[i] != -1){
DestroyPickup(tombstonePickups[i]);
#if defined USE_OBJECT
DestroyObject(tombstoneObjects[i]);
#endif
}
}
return 1;
}
public OnGameModeInit()
{
for(new i = 0; i < MAX_PLAYERS; i++){
tombstonePickups[i] = -1;
#if defined USE_OBJECT
tombstoneObjects[i] = -1;
#endif
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(tombstonePickups[playerid] != -1){
DestroyPickup(tombstonePickups[playerid]);
tombstonePickups[playerid] = -1;
#if defined USE_OBJECT
DestroyObject(tombstoneObjects[playerid]);
tombstoneObjects[playerid] = -1;
#endif
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(tombstonePickups[playerid] != -1){
DestroyPickup(tombstonePickups[playerid]);
#if defined USE_OBJECT
DestroyObject(tombstoneObjects[playerid]);
#endif
}
new Float:pX, Float:pY, Float:pZ;
GetPlayerPos(playerid, pX, pY, pZ);
#if defined USE_OBJECT
new Float:pA;
GetPlayerFacingAngle(playerid, pA);
tombstonePickups[playerid] = CreatePickup(1254,23,pX,pY,pZ+0.3,GetPlayerVirtualWorld(playerid));
tombstoneObjects[playerid] = CreateObject(2896,pX,pY,pZ-0.5,0,0,pA+90);
#else
tombstonePickups[playerid] = CreatePickup(1254,23,pX,pY,pZ,GetPlayerVirtualWorld(playerid));
#endif
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
for(new i = 0; i < MAX_PLAYERS; i++){
if(pickupid == tombstonePickups[i]){
new tombstring[MAX_PLAYER_NAME+20];
GetPlayerName(i,tombstring,MAX_PLAYER_NAME);
strins(tombstring, "~r~Here lies:~n~~w~", 0);
GameTextForPlayer(playerid,tombstring,5000,3);
break;
}
}
return 1;
}