new Pickup;new Float:RandomPickupSpawns[2][3] = // pickup koordináták{ {x,y,z}, {x,y,z}};forward SpawnRandomPickup();public SpawnRandomPickup() // pickup spawnolás{ new rand = random(sizeof(RandomPickupSpawns)); CreatePickup(1276, 2, RandomPickupSpawns[rand][0], RandomPickupSpawns[rand][1], RandomPickupSpawns[rand][2], -1); return 1;}public OnPlayerPickUpPickup(playerid, pickupid){ if(pickupid == Pickup) // amikor felveszi { GivePlayerMoney(playerid, 3000); // adunk neki pénztGivePlayerWeapon(playerid, 26, 500); // és fegyvertDestroyPickup(Pickup); // majd töröljük a pickupotSpawnRandomPickup(); // és spawnolunk egy újat } return 1;}
/*AddPlayerClass(217,2037.9685,790.6490,11.3516,335.2168,0,0,0,0,0,0); // Pickup1 (fõ)AddPlayerClass(217,2042.0023,770.2899,11.2504,268.4762,0,0,0,0,0,0); // Pickup2 (fõ)*/new Pickup;new Float:RandomPickupSpawns[2][3] = // pickup koordináták{ {2037.9685,790.6490,11.3516}, {2042.0023,770.2899,11.2504}};forward SpawnRandomPickup();public SpawnRandomPickup() // pickup spawnolás{ new rand = random(sizeof(RandomPickupSpawns)); CreatePickup(1276, 2, RandomPickupSpawns[rand][0], RandomPickupSpawns[rand][1], RandomPickupSpawns[rand][2], -1); CreatePickup(1276, 2, RandomPickupSpawns[rand][0], RandomPickupSpawns[rand][1], RandomPickupSpawns[rand][2], -1); return 1; }public OnPlayerPickUpPickup(playerid, pickupid){ if(pickupid == Pickup) // amikor felveszi { GivePlayerMoney(playerid, 3000); // adunk neki pénztGivePlayerWeapon(playerid, 31, 250); // és fegyvertSendClientMessage(playerid,zold,\"Te fölvettél egy bónuszdobozt! Találtál benne: 3.000$-t és 250 lõszernyi M4-et!\");DestroyPickup(Pickup); // majd töröljük a pickupotSpawnRandomPickup(); // és spawnolunk egy úja } return 1;}