must be a constant expression; assumed zero
public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
switch (pickupid)
{
case PlayerInfo[playerid][pPickup][0]:
{
if (PlayerInfo[playerid][pInAirport])
{
DestroyDynamicPickup(PlayerInfo[playerid][pPickup][0]);
DestroyDynamicObject(PlayerInfo[playerid][pBaggageObject]);
SetPlayerAttachedObject(playerid, 0, 11745, 6, 0.216000, 0.035000, 0.017999, -83.600013, -94.400039, -6.899996, 0.632999, 1.093000, 1.214999);
PlayerPlaySound(playerid, 1149, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have collected your baggage, please proceed to the exit (white arrows).");
PlayerInfo[playerid][pPickup][1] = CreateDynamicPickup(1318, 23, 1727.2003, -2368.4248, -73.3924, AIRPORT_WORLD, 0, playerid);
PlayerInfo[playerid][pPickup][2] = CreateDynamicPickup(1318, 23, 1719.7932,-2368.6470,-73.3924, AIRPORT_WORLD, 0, playerid);
}
}
case PlayerInfo[playerid][pPickup][1], PlayerInfo[playerid][pPickup][2]:
{
if (PlayerInfo[playerid][pInAirport])
{
DestroyDynamicPickup(PlayerInfo[playerid][pPickup][1]);
DestroyDynamicPickup(PlayerInfo[playerid][pPickup][2]);
RemovePlayerAttachedObject(playerid, 0);
PlayerInfo[playerid][pInAirport] = 0;
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid, 1642.3411, -2238.3843, 13.4976);
SetPlayerFacingAngle(playerid, 180.0);
SetCameraBehindPlayer(playerid);
ClearChat(playerid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Welcome to Los Santos Life Roleplay!");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "If you need help getting around in the server, then please type /guide.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have been given $2500 to get started.");
GiveMoney(playerid, 2500);
}
}
}
return 1;
}
|
Originally Posted by pawn-lang
Each \case clause" starts with the keyword case followed by a constant
list and one statement. The constant list is a series of expressions, separated by comma's, that each evaluates to a constant value. The constant list ends with a colon. To specify a \range" in the constant list, separate the lower and upper bounds of the range with a double period (\.."). An example of a range is: \case 1..9:". |