29.06.2015, 02:46
Give a try:
I didn't find any real error to be honest... when do you crash exactly? When you get into the pickup?
PD: that's true, use type 3 instead of type 1.
PHP код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == CP1)
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 10000$", "Select", "Cancel");
return 1;
}
if(pickupid == TP)
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 10000$", "Select", "Cancel");
return 1;
}
if(pickupid == TP1)
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 10000$", "Select", "Cancel");
return 1;
}
if(pickupid == health)
{
if(GetPlayerMoney(playerid) < 10000)
{
SendClientMessage(playerid,COLOR_RED,"You don't have enough money to buy this!");
return 1;
}
SetPlayerHealth(playerid, 100.0);
GivePlayerMoney(playerid, -10000);
SendClientMessage(playerid, 808080, "You're successfully healed for 10000$");
return 1;
}
if(pickupid == Jetpack)
{
if(gTeam[playerid] == C1)
{
return 1;
}
else
{
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
SetPlayerMapIcon(playerid, Ammu, -396.3205, 2236.0513, 42.4297, 20, 0, MAPICON_GLOBAL);
SendClientMessage(playerid,-1,"{FF0000}[JETPACK]{ffffff}You stole the jetpack, quickly take it to the place on the map.");
DestroyPickup(Jetpack);
SetTimer("StealAgain", 1200000, false);
for(new i = 0, t = GetPlayerPoolSize(); i <= t; i++)
{
if(gTeam[i] == C1)
{
GameTextForPlayer(i,"~b~Cops ~N~~W~intruder stole the ~N~~R~jetpack~W~ ~N~stop him immediately!", 2000, 4);
}
}
}
return 1;
}
return 1;
}
PD: that's true, use type 3 instead of type 1.