problem with pickup id <<<< -
omidi - 01.04.2013
i made 2 pickup the first pickup is like burger entrance and the other pickup if player dead it will create pickup (money icon)
so my problem is if even player goto burger shot entrance it will say u found a money !!!!
but when player dies and the pickup will be created then it all work fine but i want the pickup 2 only create aafter player dies
here u can compile it and see if u goto burger entrance pickup it says u found the money !!
Код:
#include <a_samp>
#include <core>
#include <float>
#pragma tabsize 0
new downcluck;
new moneypickup;
SetupPlayerForClassSelection(playerid)
{
SetPlayerInterior(playerid,14);
SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
SetPlayerFacingAngle(playerid, 270.0);
SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
}
public OnPlayerRequestClass(playerid, classid)
{
SetupPlayerForClassSelection(playerid);
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerPos(playerid,-1819.7742,613.3715,35.0156);
SetPlayerInterior(playerid,0);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
moneypickup = CreatePickup(1318,1,-1811.7742,613.3715,35.0156,0);//down cluck ent
return 1;
}
public OnGameModeInit()
{
SetGameModeText("Bare Script");
ShowPlayerMarkers(1);
ShowNameTags(1);
AllowAdminTeleport(1);
DisableInteriorEnterExits();
AddPlayerClass(265,1958.3783,1343.1572,15.3746,270.1425,0,0,0,0,-1,-1);
downcluck = CreatePickup(1318,1,-1816.4656,618.6737,35.5719,0);//down cluck ent
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == moneypickup){
SendClientMessage(playerid, 0xFFFFFF00, "u found money from corpse!");
GivePlayerMoney(playerid,1500); // gives dollars
return 1;
}
if(pickupid == downcluck){
SetPlayerPos(playerid,365.7349,-8.0870,1001.8516);//cluckin g bell downtown 1 ent
SetPlayerInterior(playerid, 9);
return 1;
}
return 1;
}
Re: problem with pickup id <<<< -
nor15 - 01.04.2013
try this public
PHP код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == moneypickup){
new string[64];
format(string,sizeof(string),"~w~u found some money from corpse");
mytextdraw1 = TextDrawCreate(200.799957, 170.453262,string);
TextDrawFont(mytextdraw1 , 1);
TextDrawLetterSize(mytextdraw1 , 0.449999, 1.600000);
TextDrawSetOutline(mytextdraw1 , 0);
TextDrawSetProportional(mytextdraw1 , 1);
TextDrawSetShadow(mytextdraw1 , 1);
TextDrawShowForPlayer(playerid, mytextdraw1);
return 1;
}
if(pickupid == downcluck){
SetPlayerPos(playerid,365.7349,-8.0870,1001.8516);//cluckin g bell downtown 1 ent
SetPlayerInterior(playerid, 9);
return 1;
}
return 1;
}
Re: problem with pickup id <<<< -
omidi - 01.04.2013
thanks for reply but no its not working its shows me the same action
really im confused its must work fine ! but its n
Re: problem with pickup id <<<< -
brawrr - 01.04.2013
test
Код:
#include <a_samp>
#include <core>
#include <float>
#pragma tabsize 0
new downcluck;
new moneypickup;
SetupPlayerForClassSelection(playerid)
{
SetPlayerInterior(playerid,14);
SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
SetPlayerFacingAngle(playerid, 270.0);
SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
}
public OnPlayerRequestClass(playerid, classid)
{
SetupPlayerForClassSelection(playerid);
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerPos(playerid,-1819.7742,613.3715,35.0156);
SetPlayerInterior(playerid,0);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnGameModeInit()
{
SetGameModeText("Bare Script");
ShowPlayerMarkers(1);
ShowNameTags(1);
AllowAdminTeleport(1);
DisableInteriorEnterExits();
AddPlayerClass(265,1958.3783,1343.1572,15.3746,270.1425,0,0,0,0,-1,-1);
downcluck = CreatePickup(1318,1,-1816.4656,618.6737,35.5719,0);//down cluck ent
moneypickup = CreatePickup(1318,1,-1811.7742,613.3715,35.0156,0);//down cluck ent
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == moneypickup){
SendClientMessage(playerid, 0xFFFFFF00, "u found money from corpse!");
GivePlayerMoney(playerid,1500); // gives dollars
return 1;
}
if(pickupid == downcluck){
SetPlayerPos(playerid,365.7349,-8.0870,1001.8516);//cluckin g bell downtown 1 ent
SetPlayerInterior(playerid, 9);
return 1;
}
return 1;
}
Re: problem with pickup id <<<< -
omidi - 01.04.2013
brawrr WTF !!!!
i dont want to pickup create in gamemode i wanted on death !!!!
Re: problem with pickup id <<<< -
brawrr - 01.04.2013
sorry, try this...
PHP код:
#include <a_samp>
#include <core>
#include <float>
#pragma tabsize 0
new downcluck;
new moneypickup;
new moneypickupammount[MAX_PLAYERS];
SetupPlayerForClassSelection(playerid)
{
SetPlayerInterior(playerid,14);
SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
SetPlayerFacingAngle(playerid, 270.0);
SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
}
public OnPlayerRequestClass(playerid, classid)
{
SetupPlayerForClassSelection(playerid);
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerPos(playerid,-1819.7742,613.3715,35.0156);
SetPlayerInterior(playerid,0);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
moneypickup[playerid] = CreatePickup(1318,1,x,y,z,0);//down cluck ent
return 1;
}
public OnGameModeInit()
{
SetGameModeText("Bare Script");
ShowPlayerMarkers(1);
ShowNameTags(1);
AllowAdminTeleport(1);
DisableInteriorEnterExits();
AddPlayerClass(265,1958.3783,1343.1572,15.3746,270.1425,0,0,0,0,-1,-1);
downcluck = CreatePickup(1318,1,-1816.4656,618.6737,35.5719,0);//down cluck ent
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
for(new mpa = 0; mpa < sizeof(moneypickupammount); mpa++)
{
if(pickupid == moneypickup[mpa])
{
SendClientMessage(playerid, 0xFFFFFF00, "u found money from corpse!");
GivePlayerMoney(playerid,1500); // gives dollars
return 1;
}
}
if(pickupid == downcluck){
SetPlayerPos(playerid,365.7349,-8.0870,1001.8516);//cluckin g bell downtown 1 ent
SetPlayerInterior(playerid, 9);
return 1;
}
return 1;
}
Re: problem with pickup id <<<< -
[CG]Milito - 01.04.2013
Hold on,
You want create a pickup where the player died?
If so
try this
pawn Код:
public OnPlayerDeath(playerid,killerid,reason)
{
New Float:Pos[2];
GetPlayerPos(playerid,Pos[0], Pos[1], Pos[2];
moneypickup[playerid] = CreatePickup(1318,1,Pos[0],Pos[1],Pos[2]);
return 1;
}
Re: problem with pickup id <<<< -
kamzaf - 01.04.2013
EDIT: nvm.