27.07.2011, 13:05
I was thinking about making an arrow that points down, and use it as a pickup and when players come close to it, they die. How do I do it?
I was thinking about making an arrow that points down, and use it as a pickup and when players come close to it, they die. How do I do it?
|
new cash;
public OnGameModeInit()
{
cash = CreatePickup(1274, 2, 0.0, 0.0, 9.0);
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == cash) GivePlayerMoney(playerid,10000);
return 1;
}
new arrow;
public OnGameModeInit()
{
arrow = CreatePickup(dontremember, coords, 9.0); //whats that 9.0? The type of pickup?
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == arrow) SetPlayerHealth(playerid,0);
return 1;
}
pawn Код:
|
CreatePickup(model, type, Float:X, Float:Y, Float:Z, Virtualworld) model The model of the pickup. type The pickup spawn type. Float:X The X coordinate to create the pickup at. Float:Y The Y coordinate to create the pickup at. Float:Z The Z coordinate to create the pickup at. virtualworld The virtual world ID of the pickup. Use -1 to make the pickup show in all worlds.
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == arrow) SetPlayerHealth(playerid,0);
return 1;
}
{
if(pickupid == cash) GivePlayerMoney(playerid,10000);
return 1;
}
C:\Users\Aрalsteinn\Desktop\Mine\gamemodes\XS.pwn(6608) : error 055: start of function body without function header
C:\Users\Aрalsteinn\Desktop\Mine\gamemodes\XS.pwn(6609) : error 010: invalid function or declaration
C:\Users\Aрalsteinn\Desktop\Mine\gamemodes\XS.pwn(6610) : error 010: invalid function or declaration
C:\Users\Aрalsteinn\Desktop\Mine\gamemodes\XS.pwn(266) : warning 204: symbol is assigned a value that is never used: "cash"
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == arrow)
{
SetPlayerHealth(playerid,0);
}
else if(pickupid == cash)
{
GivePlayerMoney(playerid,10000);
}
return 1;
}